Compare commits

...

2 Commits

Author SHA1 Message Date
983f8cb429 【新增】隐私政策分类接口 2025-11-17 16:15:37 +08:00
0d9ae593c6 【改进】隐私政策分类 2025-11-17 16:15:26 +08:00
2 changed files with 21 additions and 0 deletions

View File

@@ -40,4 +40,9 @@ public class PrivacyPolicy extends BaseEntity {
* 排序 * 排序
*/ */
private Integer sort; private Integer sort;
/**
* 类型
*/
private Integer category;
} }

View File

@@ -1,5 +1,7 @@
package com.corewing.app.modules.app; 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.entity.PrivacyPolicy;
import com.corewing.app.service.PrivacyPolicyService; import com.corewing.app.service.PrivacyPolicyService;
import org.springframework.stereotype.Controller; 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.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
@@ -34,4 +37,17 @@ public class AppPrivacyPolicyController {
return "app/privacyPolicy/index"; 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));
}
} }