Selaa lähdekoodia

帮助 学院

linweichao 4 tuntia sitten
vanhempi
commit
9236705f78

+ 32 - 0
qnfhq-api/src/main/java/com/qnfhq/modules/business/controller/AppHelpCenterController.java

@@ -0,0 +1,32 @@
+package com.qnfhq.modules.business.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.qnfhq.common.utils.Result;
+import com.qnfhq.modules.business.entity.HelpCenter;
+import com.qnfhq.modules.business.service.ITHelpCenterService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/api/helpcenter")
+public class AppHelpCenterController{
+
+    @Autowired
+    private ITHelpCenterService tHelpCenterService;
+
+    /**
+     * 查询帮助中心列表
+     */
+    @GetMapping("/getHelpList")
+    public Result<IPage<HelpCenter>> getHelpList(@RequestParam(defaultValue = "1") Integer pageNum,
+                              @RequestParam(defaultValue = "10") Integer pageSize,
+                              @RequestParam(required = true) Integer type,
+                              @RequestParam(defaultValue = "1") String enable){
+        IPage<HelpCenter> helpList = tHelpCenterService.getHelpList(pageNum, pageSize, type, enable);
+        return new Result().ok(helpList);
+    }
+
+}

+ 19 - 0
qnfhq-api/src/main/java/com/qnfhq/modules/business/dao/THelpCenterMapper.java

@@ -0,0 +1,19 @@
+package com.qnfhq.modules.business.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.qnfhq.modules.business.entity.HelpCenter;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * 帮助中心Mapper接口
+ * 
+ * @author table
+ * @date 2023-08-17
+ */
+@Mapper
+public interface THelpCenterMapper extends BaseMapper<HelpCenter>
+{
+
+}

+ 59 - 0
qnfhq-api/src/main/java/com/qnfhq/modules/business/entity/HelpCenter.java

@@ -0,0 +1,59 @@
+package com.qnfhq.modules.business.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+
+import com.qnfhq.common.entity.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+/**
+ * 帮助中心对象 t_help_center
+ *
+ * @author table
+ * @date 2023-08-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("t_help_center")
+public class HelpCenter extends BaseEntity {
+
+private static final long serialVersionUID=1L;
+
+    /**
+     * $column.columnComment
+     */
+        @TableId(value = "id",type = IdType.AUTO)
+    private Long id;
+    /**
+     * 标题
+     */
+    private String title;
+    /**
+     * 语言
+     */
+    private String language;
+    /**
+     * 1=启用 2=禁用
+     */
+    private String enable;
+    /**
+     * 0=正常 1=删除
+     */
+    private String delFlag;
+    /**
+     * $column.columnComment
+     */
+    private String showSymbol;
+    /**
+     *  1 学院 2 帮助中心
+     */
+    private int type;
+    /**
+     * 文章封面
+     */
+    private String titleImage;
+
+
+}

+ 20 - 0
qnfhq-api/src/main/java/com/qnfhq/modules/business/service/ITHelpCenterService.java

@@ -0,0 +1,20 @@
+package com.qnfhq.modules.business.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.qnfhq.modules.business.entity.HelpCenter;
+
+import java.util.List;
+
+/**
+ * 帮助中心Service接口
+ * 
+ * @author table
+ * @date 2023-08-17
+ */
+public interface ITHelpCenterService extends IService<HelpCenter>
+{
+
+
+    IPage<HelpCenter> getHelpList(Integer pageNum, Integer pageSize, Integer type, String enable);
+}

+ 41 - 0
qnfhq-api/src/main/java/com/qnfhq/modules/business/service/impl/THelpCenterServiceImpl.java

@@ -0,0 +1,41 @@
+package com.qnfhq.modules.business.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qnfhq.modules.business.dao.THelpCenterMapper;
+import com.qnfhq.modules.business.entity.HelpCenter;
+import com.qnfhq.modules.business.entity.MingProduct;
+import com.qnfhq.modules.business.service.ITHelpCenterService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 帮助中心Service业务层处理
+ * 
+ * @author table
+ * @date 2023-08-17
+ */
+@Service
+public class THelpCenterServiceImpl extends ServiceImpl<THelpCenterMapper, HelpCenter> implements ITHelpCenterService
+{
+    @Autowired
+    private THelpCenterMapper tHelpCenterMapper;
+
+
+    @Override
+    public IPage<HelpCenter> getHelpList(Integer pageNum, Integer pageSize, Integer type, String enable) {
+
+        IPage<HelpCenter> page = new Page<>(pageNum, pageSize);
+        LambdaQueryWrapper<HelpCenter> lambda = new QueryWrapper<HelpCenter>().lambda();
+        lambda.eq(HelpCenter::getEnable,enable);
+        lambda.eq(type != null ,HelpCenter::getType,type);
+        IPage<HelpCenter> helpCenterIPage = tHelpCenterMapper.selectPage(page, lambda);
+        return helpCenterIPage;
+    }
+}

+ 2 - 5
qnfhq-api/src/main/java/com/qnfhq/utils/password/PasswordUtils.java

@@ -51,11 +51,8 @@ public class PasswordUtils {
 
 
     public static void main(String[] args) {
-        String str = "admin";
-        String password = encode(str);
-
-        System.out.println(password);
-        System.out.println(matches(str, password));
+        String str = "13175458493";
+        System.out.println(matches(str, "$2a$10$enlqKhZDrdYaxoC5fxYD.ee0Km.JPEEgzRvlHG5O19nRENLYwJCKy"));
     }
 
 }