he2802 4 년 전
부모
커밋
113947eea0

+ 72 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/course/CourseChapterController.java

@@ -0,0 +1,72 @@
+package com.zhongzheng.controller.course;
+
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.zhongzheng.common.annotation.Log;
+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.enums.BusinessType;
+import com.zhongzheng.modules.course.bo.CourseChapterAddBo;
+import com.zhongzheng.modules.course.bo.CourseChapterEditBo;
+import com.zhongzheng.modules.course.bo.CourseChapterQueryBo;
+import com.zhongzheng.modules.course.service.ICourseChapterService;
+import com.zhongzheng.modules.course.vo.CourseChapterVo;
+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.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 课程大章Controller
+ *
+ * @author hjl
+ * @date 2021-05-19
+ */
+@Api(value = "课程大章控制器", tags = {"课程大章管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/app/common/course/chapter")
+public class CourseChapterController extends BaseController {
+
+    private final ICourseChapterService iCourseChapterService;
+
+    /**
+     * 查询课程大章列表
+     */
+    @ApiOperation("查询课程大章列表")
+    @GetMapping("/list")
+    public TableDataInfo<CourseChapterVo> list(CourseChapterQueryBo bo) {
+        startPage();
+        List<CourseChapterVo> list = iCourseChapterService.queryList(bo);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出课程大章列表
+     */
+    /*@ApiOperation("导出课程大章列表")
+    @PreAuthorize("@ss.hasPermi('course:chapter:export')")
+    @Log(title = "课程大章", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult<CourseChapterVo> export(CourseChapterQueryBo bo) {
+        List<CourseChapterVo> list = iCourseChapterService.queryList(bo);
+        ExcelUtil<CourseChapterVo> util = new ExcelUtil<CourseChapterVo>(CourseChapterVo.class);
+        return util.exportExcel(list, "课程大章");
+    }*/
+
+    /**
+     * 获取课程大章详细信息
+     */
+    @ApiOperation("获取课程大章详细信息")
+    @GetMapping("/{chapterId}")
+    public AjaxResult<CourseChapterVo> getInfo(@PathVariable("chapterId" ) Long chapterId) {
+        return AjaxResult.success(iCourseChapterService.queryById(chapterId));
+    }
+
+
+}

+ 59 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/course/CourseSectionController.java

@@ -0,0 +1,59 @@
+package com.zhongzheng.controller.course;
+
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.zhongzheng.common.annotation.Log;
+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.enums.BusinessType;
+import com.zhongzheng.modules.course.bo.CourseSectionAddBo;
+import com.zhongzheng.modules.course.bo.CourseSectionEditBo;
+import com.zhongzheng.modules.course.bo.CourseSectionQueryBo;
+import com.zhongzheng.modules.course.service.ICourseSectionService;
+import com.zhongzheng.modules.course.vo.CourseSectionVo;
+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.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 课程小节Controller
+ *
+ * @author hjl
+ * @date 2021-05-19
+ */
+@Api(value = "课程小节控制器", tags = {"课程小节管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/app/common/course/section")
+public class CourseSectionController extends BaseController {
+
+    private final ICourseSectionService iCourseSectionService;
+
+    /**
+     * 查询课程小节列表
+     */
+    @ApiOperation("查询课程小节列表")
+    @GetMapping("/list")
+    public TableDataInfo<CourseSectionVo> list(CourseSectionQueryBo bo) {
+        startPage();
+        List<CourseSectionVo> list = iCourseSectionService.selectList(bo);
+        return getDataTable(list);
+    }
+
+    /**
+     * 获取课程小节详细信息
+     */
+    @ApiOperation("获取课程小节详细信息")
+    @GetMapping("/{sectionId}")
+    public AjaxResult<CourseSectionVo> getInfo(@PathVariable("sectionId" ) Long sectionId) {
+        return AjaxResult.success(iCourseSectionService.queryById(sectionId));
+    }
+
+}

+ 2 - 1
zhongzheng-api/src/main/java/com/zhongzheng/controller/face/FaceController.java

@@ -53,7 +53,8 @@ public class FaceController extends BaseController {
     @ApiOperation("获取人照识别凭证")
     @GetMapping("/certification/PicBizToken")
     public AjaxResult<FaceVo> getPicBizToken() throws Exception {
-        FaceVo face = iFaceService.getFaceDetectAuth("1");
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        FaceVo face = iFaceService.getPicFaceDetectAuth("1",loginUser.getUser().getUserId());
         return AjaxResult.success(face);
     }
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/face/service/IFaceService.java

@@ -9,4 +9,6 @@ public interface IFaceService {
 
     void getDetectInfo(String bizToken,Long userId);
 
+    FaceVo getPicFaceDetectAuth(String RuleId,Long userId);
+
 }

+ 33 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/face/service/impl/FaceServiceImpl.java

@@ -48,6 +48,8 @@ public class FaceServiceImpl implements IFaceService {
     @Autowired
     private UserMapper userMapper;
 
+
+
     @Override
     public FaceVo getFaceDetectAuth(String RuleId) {
         try{
@@ -134,4 +136,35 @@ public class FaceServiceImpl implements IFaceService {
             System.out.println(e.toString());
         }
     }
+
+    @Override
+    public FaceVo getPicFaceDetectAuth(String RuleId,Long userId) {
+        try{
+            Credential cred = new Credential(SecretId, SecretKey);
+
+            HttpProfile httpProfile = new HttpProfile();
+            httpProfile.setEndpoint("faceid.tencentcloudapi.com");
+            ClientProfile clientProfile = new ClientProfile();
+            clientProfile.setHttpProfile(httpProfile);
+            FaceidClient client = new FaceidClient(cred, "", clientProfile);
+
+
+            User user = userMapper.selectById(userId);
+            if(user.getCertified()==1){
+                String IdCard = user.getIdCard();
+                String Name = user.getRealname();
+                String ImageBase64 = user.getRealname();
+                String params = "{\"RuleId\":\""+RuleId+"\",\"IdCard\":\"\"+RuleId+\"\\\"}";
+                DetectAuthRequest req = DetectAuthRequest.fromJsonString(params, DetectAuthRequest.class);
+                //        DetectAuthRequest req = new DetectAuthRequest();
+                DetectAuthResponse resp = client.DetectAuth(req);
+                System.out.println(DetectAuthResponse.toJsonString(resp));
+                FaceVo vo = BeanUtil.toBean(resp, com.zhongzheng.modules.face.bo.FaceVo.class);
+                return vo;
+            }
+        } catch (TencentCloudSDKException e) {
+            System.out.println(e.toString());
+        }
+        return null;
+    }
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserOcrService.java

@@ -24,6 +24,8 @@ public interface IUserOcrService extends IService<UserOcr> {
 	 */
 	UserOcrVo queryById(Long ocrId);
 
+	UserOcr queryByUserId(Long userId);
+
 	/**
 	 * 查询列表
 	 */

+ 9 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserOcrServiceImpl.java

@@ -3,6 +3,7 @@ package com.zhongzheng.modules.user.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
 import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.modules.course.domain.MajorCategory;
 import com.zhongzheng.modules.user.bo.UserOcrAddBo;
 import com.zhongzheng.modules.user.bo.UserOcrEditBo;
 import com.zhongzheng.modules.user.bo.UserOcrQueryBo;
@@ -36,6 +37,14 @@ public class UserOcrServiceImpl extends ServiceImpl<UserOcrMapper, UserOcr> impl
         return BeanUtil.toBean(db, UserOcrVo.class);
     }
 
+    @Override
+    public UserOcr queryByUserId(Long userId) {
+        UserOcr info = getOne(new LambdaQueryWrapper<UserOcr>()
+                .eq(UserOcr::getUserId,userId)
+                .last("limit 1"));
+        return info;
+    }
+
     @Override
     public List<UserOcrVo> queryList(UserOcrQueryBo bo) {
         LambdaQueryWrapper<UserOcr> lqw = Wrappers.lambdaQuery();