血脉初建
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
package com.peanut.modules.book.controller;
|
package com.peanut.modules.book.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.peanut.common.utils.R;
|
import com.peanut.common.utils.R;
|
||||||
import com.peanut.modules.book.entity.PointCategoryEntity;
|
import com.peanut.modules.book.entity.PointCategoryEntity;
|
||||||
|
import com.peanut.modules.book.entity.PointEntity;
|
||||||
import com.peanut.modules.book.service.PointCategoryService;
|
import com.peanut.modules.book.service.PointCategoryService;
|
||||||
import com.peanut.modules.book.service.PointService;
|
import com.peanut.modules.book.service.PointService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -61,4 +63,47 @@ public class PointController {
|
|||||||
pointCategoryService.updateById(p);
|
pointCategoryService.updateById(p);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取脉穴文章列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getPointList")
|
||||||
|
public R getPointList(@RequestBody Map<String,Object> map){
|
||||||
|
Page<PointEntity> pointList = pointService.getPointList(map);
|
||||||
|
return R.ok().put("page",pointList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加脉穴文章
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/addPoint")
|
||||||
|
public R addPoint(@RequestBody PointEntity pointEntity){
|
||||||
|
pointService.save(pointEntity);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除脉穴文章
|
||||||
|
* @param map
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/delPoint")
|
||||||
|
public R delPoint(@RequestBody Map<String,Object> map){
|
||||||
|
Integer pointId = Integer.valueOf(map.get("pointId").toString());
|
||||||
|
pointService.removeById(pointId);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改脉穴文章
|
||||||
|
* @param pointEntity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/editPoint")
|
||||||
|
public R editPoint(@RequestBody PointEntity pointEntity){
|
||||||
|
pointService.updateById(pointEntity);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ public class PointEntity implements Serializable {
|
|||||||
@TableId(type = IdType.AUTO)
|
@TableId(type = IdType.AUTO)
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
|
||||||
private Integer pointCategoryId;
|
private Integer pointCategoryId;
|
||||||
|
|
||||||
private String alias;
|
private String alias;
|
||||||
|
|||||||
@@ -2,10 +2,13 @@ package com.peanut.modules.book.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.peanut.modules.book.entity.PointCategoryEntity;
|
import com.peanut.modules.book.entity.PointCategoryEntity;
|
||||||
|
import com.peanut.modules.book.entity.PointEntity;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public interface PointCategoryService extends IService<PointCategoryEntity> {
|
public interface PointCategoryService extends IService<PointCategoryEntity> {
|
||||||
|
|
||||||
List<PointCategoryEntity> getCategoryList();
|
List<PointCategoryEntity> getCategoryList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
package com.peanut.modules.book.service;
|
package com.peanut.modules.book.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.peanut.modules.book.entity.PointEntity;
|
import com.peanut.modules.book.entity.PointEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public interface PointService extends IService<PointEntity> {
|
public interface PointService extends IService<PointEntity> {
|
||||||
|
|
||||||
|
|
||||||
|
Page<PointEntity> getPointList(Map<String,Object> map);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
package com.peanut.modules.book.service.impl;
|
package com.peanut.modules.book.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.peanut.modules.book.dao.PointCategoryDao;
|
import com.peanut.modules.book.dao.PointCategoryDao;
|
||||||
import com.peanut.modules.book.entity.PointCategoryEntity;
|
import com.peanut.modules.book.entity.PointCategoryEntity;
|
||||||
|
import com.peanut.modules.book.entity.PointEntity;
|
||||||
import com.peanut.modules.book.service.PointCategoryService;
|
import com.peanut.modules.book.service.PointCategoryService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Service("pointCategoryService")
|
@Service("pointCategoryService")
|
||||||
public class PointCategoryServiceImpl extends ServiceImpl<PointCategoryDao, PointCategoryEntity> implements PointCategoryService {
|
public class PointCategoryServiceImpl extends ServiceImpl<PointCategoryDao, PointCategoryEntity> implements PointCategoryService {
|
||||||
@@ -29,5 +32,4 @@ public class PointCategoryServiceImpl extends ServiceImpl<PointCategoryDao, Poin
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,53 @@
|
|||||||
package com.peanut.modules.book.service.impl;
|
package com.peanut.modules.book.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.peanut.modules.book.dao.PointCategoryDao;
|
||||||
import com.peanut.modules.book.dao.PointDao;
|
import com.peanut.modules.book.dao.PointDao;
|
||||||
|
import com.peanut.modules.book.entity.PointCategoryEntity;
|
||||||
import com.peanut.modules.book.entity.PointEntity;
|
import com.peanut.modules.book.entity.PointEntity;
|
||||||
import com.peanut.modules.book.service.PointService;
|
import com.peanut.modules.book.service.PointService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Service("pointService")
|
@Service("pointService")
|
||||||
public class PointServiceImpl extends ServiceImpl<PointDao, PointEntity> implements PointService {
|
public class PointServiceImpl extends ServiceImpl<PointDao, PointEntity> implements PointService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PointCategoryDao pointCategoryDao;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<PointEntity> getPointList(Map<String, Object> map) {
|
||||||
|
Integer limit = Integer.valueOf(map.get("limit").toString());
|
||||||
|
Integer page = Integer.valueOf(map.get("page").toString());
|
||||||
|
LambdaQueryWrapper<PointEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
if(map.containsKey("pointCategoryId")&& StringUtils.isNotBlank(map.get("pointCategoryId").toString())){
|
||||||
|
Integer id = Integer.valueOf(map.get("pointCategoryId").toString());
|
||||||
|
List<Integer> ids = new ArrayList<>();
|
||||||
|
createIds(id,ids);
|
||||||
|
wrapper.in(PointEntity::getPointCategoryId,ids);
|
||||||
|
}
|
||||||
|
wrapper.orderByDesc(PointEntity::getSort);
|
||||||
|
Page<PointEntity> pointEntityPage = getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
|
||||||
|
return pointEntityPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void createIds(Integer id,List<Integer> list){
|
||||||
|
LambdaQueryWrapper<PointCategoryEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(PointCategoryEntity::getPid,id);
|
||||||
|
List<PointCategoryEntity> pointCategoryEntities = pointCategoryDao.selectList(wrapper);
|
||||||
|
for (PointCategoryEntity p :pointCategoryEntities){
|
||||||
|
createIds(p.getId(),list);
|
||||||
|
}
|
||||||
|
list.add(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,18 +9,18 @@ wxpay.notifyUrl:https://testapi.nuttyreading.com/pay/payNotify
|
|||||||
# ?? url
|
# ?? url
|
||||||
wxpay.refundNotifyUrl:http://pjm6m9.natappfree.cc/pay/refundNotify
|
wxpay.refundNotifyUrl:http://pjm6m9.natappfree.cc/pay/refundNotify
|
||||||
# key pem
|
# 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: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
|
wxpay.serialNo:679AECB2F7AC4183033F713828892BA640E4EEE3
|
||||||
# API v3 key
|
# API v3 key
|
||||||
wxpay.apiV3Key:4aYFklzaULeGlr7oJPZ6rHWKcxjihZUF
|
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: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
|
# ?? 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: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
|
||||||
Reference in New Issue
Block a user