package com.zhongzheng.controller.user; import com.zhongzheng.common.core.controller.BaseController; import com.zhongzheng.common.core.domain.AjaxResult; import com.zhongzheng.common.core.page.TableDataInfo; import com.zhongzheng.common.utils.ServletUtils; import com.zhongzheng.framework.web.service.WxTokenService; import com.zhongzheng.modules.user.bo.UserCertificateQueryBo; import com.zhongzheng.modules.user.entity.ClientLoginUser; import com.zhongzheng.modules.user.service.IUserCertificateService; import com.zhongzheng.modules.user.vo.UserCertificateVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; 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.RestController; import java.util.List; /** * 用户证书Controller * * @author hjl * @date 2022-02-17 */ @Api(value = "用户证书控制器", tags = {"用户证书管理"}) @RequiredArgsConstructor(onConstructor_ = @Autowired) @RestController @RequestMapping("/user/certificate") public class UserCertificateController extends BaseController { private final IUserCertificateService iUserCertificateService; private final WxTokenService wxTokenService; /** * 查询用户证书列表 */ @ApiOperation("查询用户证书列表") @PreAuthorize("@ss.hasPermi('system:certificate:list')") @GetMapping("/list") public TableDataInfo list(UserCertificateQueryBo bo) { ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest()); bo.setUserId(loginUser.getUser().getUserId()); startPage(); List list = iUserCertificateService.selectList(bo); return getDataTable(list); } /** * 获取用户证书详细信息 */ @ApiOperation("用户证书详细信息") @PreAuthorize("@ss.hasPermi('system:certificate:query')") @GetMapping("/{id}") public AjaxResult getInfo(@PathVariable("id" ) Long id) { return AjaxResult.success(iUserCertificateService.queryById(id)); } }