Compare commits
2 Commits
07e8151736
...
983f8cb429
| Author | SHA1 | Date | |
|---|---|---|---|
| 983f8cb429 | |||
| 0d9ae593c6 |
@@ -40,4 +40,9 @@ public class PrivacyPolicy extends BaseEntity {
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private Integer category;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.corewing.app.modules.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.corewing.app.common.Result;
|
||||
import com.corewing.app.entity.PrivacyPolicy;
|
||||
import com.corewing.app.service.PrivacyPolicyService;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@@ -7,6 +9,7 @@ import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
@@ -34,4 +37,17 @@ public class AppPrivacyPolicyController {
|
||||
return "app/privacyPolicy/index";
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据类型获取集合数据
|
||||
* @param category
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getListByCategory/{category}")
|
||||
@ResponseBody
|
||||
public Result<PrivacyPolicy> getListByCategory(@PathVariable Integer category) {
|
||||
LambdaQueryWrapper<PrivacyPolicy> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PrivacyPolicy::getCategory, category);
|
||||
return Result.success(privacyPolicyService.getOne(wrapper));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user