血脉初建

This commit is contained in:
wangjinlei
2023-11-02 13:24:19 +08:00
parent 82f8201468
commit 2996a1bbc7
7 changed files with 107 additions and 11 deletions

View File

@@ -0,0 +1,64 @@
package com.peanut.modules.book.controller;
import com.peanut.common.utils.R;
import com.peanut.modules.book.entity.PointCategoryEntity;
import com.peanut.modules.book.service.PointCategoryService;
import com.peanut.modules.book.service.PointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("book/point")
public class PointController {
@Autowired
private PointService pointService;
@Autowired
private PointCategoryService pointCategoryService;
/**
* 获取脉穴分类列表-树形结构
* @return
*/
@RequestMapping("/getPointCategoryList")
public R getPointCategoryList(){
List<PointCategoryEntity> categoryList = pointCategoryService.getCategoryList();
return R.ok().put("categorys",categoryList);
}
/**
* 添加脉穴分类
* @return
*/
@RequestMapping("/addPointCategory")
public R addPointCategory(@RequestBody PointCategoryEntity p){
pointCategoryService.save(p);
return R.ok();
}
/**
* 删除脉穴分类
* @return
*/
@RequestMapping("/delPointCategory")
public R delPointCategory(@RequestBody Map<String,Object> map){
Integer id = Integer.valueOf(map.get("pointCategoryId").toString());
pointCategoryService.removeById(id);
return R.ok();
}
/**
* 修改脉穴分类
* @param p
* @return
*/
@RequestMapping("/editPointCategory")
public R editPointCategory(@RequestBody PointCategoryEntity p){
pointCategoryService.updateById(p);
return R.ok();
}
}

View File

@@ -1,12 +1,11 @@
package com.peanut.modules.book.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
@TableName("point_category")
@@ -23,5 +22,10 @@ public class PointCategoryEntity implements Serializable {
private Date createTime;
@TableLogic
private Integer delFlag;
@TableField(exist = false)
private List<PointCategoryEntity> children;
}

View File

@@ -2,6 +2,7 @@ package com.peanut.modules.book.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@@ -35,5 +36,6 @@ public class PointEntity implements Serializable {
private Date createTime;
@TableLogic
private Integer delFlag;
}

View File

@@ -3,5 +3,9 @@ package com.peanut.modules.book.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.peanut.modules.book.entity.PointCategoryEntity;
import java.util.List;
public interface PointCategoryService extends IService<PointCategoryEntity> {
List<PointCategoryEntity> getCategoryList();
}

View File

@@ -1,11 +1,33 @@
package com.peanut.modules.book.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.book.dao.PointCategoryDao;
import com.peanut.modules.book.entity.PointCategoryEntity;
import com.peanut.modules.book.service.PointCategoryService;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("pointCategoryService")
public class PointCategoryServiceImpl extends ServiceImpl<PointCategoryDao, PointCategoryEntity> implements PointCategoryService {
@Override
public List<PointCategoryEntity> getCategoryList() {
LambdaQueryWrapper<PointCategoryEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointCategoryEntity::getPid,0);
wrapper.orderByDesc(PointCategoryEntity::getSort);
List<PointCategoryEntity> list = list(wrapper);
for (PointCategoryEntity p : list){
LambdaQueryWrapper<PointCategoryEntity> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(PointCategoryEntity::getPid,p.getId());
wrapper1.orderByDesc(PointCategoryEntity::getSort);
List<PointCategoryEntity> list1 = list(wrapper1);
p.setChildren(list1);
}
return list;
}
}

View File

@@ -11,7 +11,7 @@ connection-timeout: 6000000ms
spring:
# 环境 dev|test|prod
profiles:
active: prod
active: dev
# jackson时间格式化
jackson:
time-zone: GMT+8

View File

@@ -5,22 +5,22 @@ wxpay.mchId:1612860909
# ?? URL
wxpay.payUrl:https://api.mch.weixin.qq.com/v3/pay/transactions/app
# ????
wxpay.notifyUrl:https://api.nuttyreading.com/pay/payNotify
wxpay.notifyUrl:https://testapi.nuttyreading.com/pay/payNotify
# ?? url
wxpay.refundNotifyUrl:http://pjm6m9.natappfree.cc/pay/refundNotify
# key pem
wxpay.keyPemPath:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
#wxpay.keyPemPath:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
#wxpay.keyPemPath:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
#wxpay.keyPemPath:D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
wxpay.keyPemPath:D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
# ???
wxpay.serialNo:679AECB2F7AC4183033F713828892BA640E4EEE3
# API v3 key
wxpay.apiV3Key:4aYFklzaULeGlr7oJPZ6rHWKcxjihZUF
# ????
wxpay.wechatPayCertificateUrl:/usr/local/hs/peanut_book/target/classes/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem
#wxpay.wechatPayCertificateUrl:/usr/local/hs/peanut_book/target/classes/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem
#wxpay.wechatPayCertificateUrl:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem
# wxpay.wechatPayCertificateUrl:D:/hs/nuttyreading-java/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem
wxpay.wechatPayCertificateUrl:D:/hs/nuttyreading-java/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem
# ?? url
wxpay.privateKeyUrl:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
#wxpay.privateKeyUrl:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
#wxpay.privateKeyUrl:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
#wxpay.privateKeyUrl:D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
wxpay.privateKeyUrl:D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem