v2.2 正式发布,移除jpa升级后台为mytisplus
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>yshop</artifactId>
|
||||
<groupId>co.yixiang</groupId>
|
||||
<version>2.1</version>
|
||||
<version>2.2</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -35,9 +35,9 @@
|
||||
<dependency>
|
||||
<groupId>co.yixiang</groupId>
|
||||
<artifactId>yshop-common</artifactId>
|
||||
<version>2.1</version>
|
||||
<version>2.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.builder;
|
||||
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.builder;
|
||||
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.builder;
|
||||
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.config;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.config;
|
||||
|
||||
import co.yixiang.constant.ShopConstants;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
@ -5,10 +10,11 @@ import cn.hutool.core.util.StrUtil;
|
||||
import co.yixiang.exception.BadRequestException;
|
||||
import co.yixiang.mp.domain.YxArticle;
|
||||
import co.yixiang.mp.service.YxArticleService;
|
||||
import co.yixiang.mp.service.dto.YxArticleDTO;
|
||||
import co.yixiang.mp.service.dto.YxArticleDto;
|
||||
import co.yixiang.mp.service.dto.YxArticleQueryCriteria;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@ -46,7 +52,7 @@ public class WechatArticleController {
|
||||
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_CREATE')")
|
||||
public ResponseEntity create(@Validated @RequestBody YxArticle resources){
|
||||
resources.setAddTime(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm"));
|
||||
return new ResponseEntity(yxArticleService.create(resources),HttpStatus.CREATED);
|
||||
return new ResponseEntity(yxArticleService.save(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
||||
@ -54,7 +60,7 @@ public class WechatArticleController {
|
||||
@PutMapping(value = "/yxArticle")
|
||||
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_EDIT')")
|
||||
public ResponseEntity update(@Validated @RequestBody YxArticle resources){
|
||||
yxArticleService.update(resources);
|
||||
yxArticleService.saveOrUpdate(resources);
|
||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@ -64,7 +70,7 @@ public class WechatArticleController {
|
||||
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_DELETE')")
|
||||
public ResponseEntity delete(@PathVariable Integer id){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
yxArticleService.delete(id);
|
||||
yxArticleService.removeById(id);
|
||||
return new ResponseEntity(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ -73,9 +79,11 @@ public class WechatArticleController {
|
||||
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_DELETE')")
|
||||
public ResponseEntity publish(@PathVariable Integer id) throws Exception{
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
YxArticleDTO yxArticleDTO= yxArticleService.findById(id);
|
||||
YxArticleDto yxArticleDTO= new YxArticleDto();
|
||||
YxArticle yxArticle = yxArticleService.getById(id);
|
||||
BeanUtils.copyProperties(yxArticle,yxArticleDTO);
|
||||
yxArticleService.uploadNews(yxArticleDTO);
|
||||
return new ResponseEntity(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.controller;
|
||||
|
||||
|
||||
@ -10,6 +15,7 @@ import co.yixiang.utils.OrderUtil;
|
||||
import co.yixiang.utils.RedisUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import me.chanjar.weixin.common.bean.menu.WxMenu;
|
||||
@ -41,7 +47,7 @@ public class WechatMenuController {
|
||||
@GetMapping(value = "/YxWechatMenu")
|
||||
@PreAuthorize("@el.check('admin','YxWechatMenu_ALL','YxWechatMenu_SELECT')")
|
||||
public ResponseEntity getYxWechatMenus(){
|
||||
return new ResponseEntity(YxWechatMenuService.findById("wechat_menus"),HttpStatus.OK);
|
||||
return new ResponseEntity(YxWechatMenuService.getOne(new QueryWrapper<YxWechatMenu>().eq("`key`","wechat_menus")),HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@ -60,12 +66,12 @@ public class WechatMenuController {
|
||||
if(isExist){
|
||||
YxWechatMenu.setKey("wechat_menus");
|
||||
YxWechatMenu.setResult(jsonButton);
|
||||
YxWechatMenuService.update(YxWechatMenu);
|
||||
YxWechatMenuService.saveOrUpdate(YxWechatMenu);
|
||||
}else {
|
||||
YxWechatMenu.setKey("wechat_menus");
|
||||
YxWechatMenu.setResult(jsonButton);
|
||||
YxWechatMenu.setAddTime(OrderUtil.getSecondTimestampTwo());
|
||||
YxWechatMenuService.create(YxWechatMenu);
|
||||
YxWechatMenuService.save(YxWechatMenu);
|
||||
}
|
||||
|
||||
|
||||
@ -84,4 +90,4 @@ public class WechatMenuController {
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@ -54,7 +59,7 @@ public class WechatReplyController {
|
||||
yxWechatReplyService.create(yxWechatReply);
|
||||
}else{
|
||||
yxWechatReply.setId(isExist.getId());
|
||||
yxWechatReplyService.update(yxWechatReply);
|
||||
yxWechatReplyService.upDate(yxWechatReply);
|
||||
}
|
||||
|
||||
return new ResponseEntity(HttpStatus.CREATED);
|
||||
@ -64,4 +69,4 @@ public class WechatReplyController {
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,21 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import co.yixiang.dozer.service.IGenerator;
|
||||
import co.yixiang.exception.BadRequestException;
|
||||
import co.yixiang.mp.domain.YxWechatTemplate;
|
||||
import co.yixiang.mp.service.YxWechatTemplateService;
|
||||
import co.yixiang.mp.service.dto.YxWechatTemplateDto;
|
||||
import co.yixiang.mp.service.dto.YxWechatTemplateQueryCriteria;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.java.Log;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@ -15,51 +24,61 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author xuwenbo
|
||||
* @author hupeng
|
||||
* @date 2019-12-10
|
||||
*/
|
||||
@Api(tags = "商城:微信模板管理")
|
||||
@RestController
|
||||
@RequestMapping("api")
|
||||
@RequestMapping("/api/yxWechatTemplate")
|
||||
@AllArgsConstructor
|
||||
public class WechatTemplateController {
|
||||
|
||||
|
||||
private final YxWechatTemplateService yxWechatTemplateService;
|
||||
private final IGenerator generator;
|
||||
|
||||
public WechatTemplateController(YxWechatTemplateService yxWechatTemplateService) {
|
||||
this.yxWechatTemplateService = yxWechatTemplateService;
|
||||
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('admin','yxWechatTemplate:list')")
|
||||
public void download(HttpServletResponse response, YxWechatTemplateQueryCriteria criteria) throws IOException {
|
||||
yxWechatTemplateService.download(generator.convert(yxWechatTemplateService.queryAll(criteria), YxWechatTemplateDto.class), response);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询")
|
||||
@GetMapping(value = "/yxWechatTemplate")
|
||||
@PreAuthorize("@el.check('admin','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_SELECT')")
|
||||
public ResponseEntity getYxWechatTemplates(YxWechatTemplateQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity(yxWechatTemplateService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
@GetMapping
|
||||
@ApiOperation("查询微信模板消息")
|
||||
@PreAuthorize("@el.check('admin','yxWechatTemplate:list')")
|
||||
public ResponseEntity<Object> getYxWechatTemplates(YxWechatTemplateQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(yxWechatTemplateService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增")
|
||||
@PostMapping(value = "/yxWechatTemplate")
|
||||
@PreAuthorize("@el.check('admin','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_CREATE')")
|
||||
public ResponseEntity create(@Validated @RequestBody YxWechatTemplate resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
return new ResponseEntity(yxWechatTemplateService.create(resources),HttpStatus.CREATED);
|
||||
@PostMapping
|
||||
@ApiOperation("新增微信模板消息")
|
||||
@PreAuthorize("@el.check('admin','yxWechatTemplate:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody YxWechatTemplate resources){
|
||||
return new ResponseEntity<>(yxWechatTemplateService.save(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改")
|
||||
@PutMapping(value = "/yxWechatTemplate")
|
||||
@PreAuthorize("@el.check('admin','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_EDIT')")
|
||||
public ResponseEntity update(@Validated @RequestBody YxWechatTemplate resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
yxWechatTemplateService.update(resources);
|
||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||
@PutMapping
|
||||
@ApiOperation("修改微信模板消息")
|
||||
@PreAuthorize("@el.check('admin','yxWechatTemplate:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody YxWechatTemplate resources){
|
||||
yxWechatTemplateService.updateById(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除")
|
||||
@DeleteMapping(value = "/yxWechatTemplate/{id}")
|
||||
@PreAuthorize("@el.check('admin','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_DELETE')")
|
||||
public ResponseEntity delete(@PathVariable Integer id){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
yxWechatTemplateService.delete(id);
|
||||
return new ResponseEntity(HttpStatus.OK);
|
||||
@ApiOperation("删除微信模板消息")
|
||||
@PreAuthorize("@el.check('admin','yxWechatTemplate:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> deleteAll(@RequestBody Integer[] ids) {
|
||||
Arrays.asList(ids).forEach(id->{
|
||||
yxWechatTemplateService.removeById(id);
|
||||
});
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,103 +1,115 @@
|
||||
package co.yixiang.mp.domain;
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.domain;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-07
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="yx_article")
|
||||
@TableName("yx_article")
|
||||
public class YxArticle implements Serializable {
|
||||
|
||||
// 文章管理ID
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
/** 文章管理ID */
|
||||
@TableId
|
||||
private Integer id;
|
||||
|
||||
// 分类id
|
||||
@Column(name = "cid")
|
||||
|
||||
/** 分类id */
|
||||
private String cid;
|
||||
|
||||
// 文章标题
|
||||
@Column(name = "title",nullable = false)
|
||||
|
||||
/** 文章标题 */
|
||||
@NotBlank(message = "请输入文章标题")
|
||||
private String title;
|
||||
|
||||
// 文章作者
|
||||
@Column(name = "author")
|
||||
|
||||
/** 文章作者 */
|
||||
@NotBlank(message = "请输入文章作者")
|
||||
private String author;
|
||||
|
||||
@Column(name = "content")
|
||||
private String content;
|
||||
|
||||
// 文章图片
|
||||
@Column(name = "image_input",nullable = false)
|
||||
/** 文章图片 */
|
||||
@NotBlank(message = "请上传文章图片")
|
||||
private String imageInput;
|
||||
|
||||
// 文章简介
|
||||
@Column(name = "synopsis")
|
||||
|
||||
/** 文章简介 */
|
||||
@NotBlank(message = "请填写文章简介")
|
||||
private String synopsis;
|
||||
|
||||
// 文章分享标题
|
||||
@Column(name = "share_title")
|
||||
|
||||
@NotBlank(message = "请填写文章详情")
|
||||
private String content;
|
||||
|
||||
|
||||
/** 文章分享标题 */
|
||||
private String shareTitle;
|
||||
|
||||
// 文章分享简介
|
||||
@Column(name = "share_synopsis")
|
||||
|
||||
/** 文章分享简介 */
|
||||
private String shareSynopsis;
|
||||
|
||||
// 浏览次数
|
||||
@Column(name = "visit")
|
||||
|
||||
/** 浏览次数 */
|
||||
private String visit;
|
||||
|
||||
// 排序
|
||||
@Column(name = "sort",nullable = false)
|
||||
|
||||
/** 排序 */
|
||||
private Integer sort;
|
||||
|
||||
// 原文链接
|
||||
@Column(name = "url")
|
||||
|
||||
/** 原文链接 */
|
||||
private String url;
|
||||
|
||||
// 状态
|
||||
@Column(name = "status",nullable = false)
|
||||
|
||||
/** 状态 */
|
||||
private Integer status;
|
||||
|
||||
// 添加时间
|
||||
@Column(name = "add_time",nullable = false)
|
||||
|
||||
/** 添加时间 */
|
||||
@TableField(fill= FieldFill.INSERT)
|
||||
private String addTime;
|
||||
|
||||
// 是否隐藏
|
||||
@Column(name = "hide",nullable = false)
|
||||
|
||||
/** 是否隐藏 */
|
||||
private Integer hide;
|
||||
|
||||
// 管理员id
|
||||
@Column(name = "admin_id",nullable = false)
|
||||
|
||||
/** 管理员id */
|
||||
private Integer adminId;
|
||||
|
||||
// 商户id
|
||||
@Column(name = "mer_id")
|
||||
|
||||
/** 商户id */
|
||||
private Integer merId;
|
||||
|
||||
// 产品关联id
|
||||
@Column(name = "product_id",nullable = false)
|
||||
|
||||
/** 产品关联id */
|
||||
private Integer productId;
|
||||
|
||||
// 是否热门(小程序)
|
||||
@Column(name = "is_hot",nullable = false)
|
||||
|
||||
/** 是否热门(小程序) */
|
||||
private Integer isHot;
|
||||
|
||||
// 是否轮播图(小程序)
|
||||
@Column(name = "is_banner",nullable = false)
|
||||
|
||||
/** 是否轮播图(小程序) */
|
||||
private Integer isBanner;
|
||||
|
||||
|
||||
public void copy(YxArticle source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,38 +1,37 @@
|
||||
package co.yixiang.mp.domain;
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.domain;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-06
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="yx_wechat_menu")
|
||||
@TableName("yx_wechat_menu")
|
||||
public class YxWechatMenu implements Serializable {
|
||||
|
||||
|
||||
@Id
|
||||
@Column(name = "`key`")
|
||||
@TableId(value = "`key`")
|
||||
private String key;
|
||||
|
||||
// 缓存数据
|
||||
@Column(name = "result")
|
||||
|
||||
/** 缓存数据 */
|
||||
private String result;
|
||||
|
||||
// 缓存时间
|
||||
@Column(name = "add_time")
|
||||
|
||||
/** 缓存时间 */
|
||||
@TableField(fill= FieldFill.INSERT)
|
||||
private Integer addTime;
|
||||
|
||||
|
||||
public void copy(YxWechatMenu source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,48 +1,52 @@
|
||||
package co.yixiang.mp.domain;
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.domain;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-10
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="yx_wechat_reply")
|
||||
@TableName("yx_wechat_reply")
|
||||
public class YxWechatReply implements Serializable {
|
||||
|
||||
// 微信关键字回复id
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
/** 微信关键字回复id */
|
||||
@TableId
|
||||
private Integer id;
|
||||
|
||||
// 关键字
|
||||
@Column(name = "`key`",unique = true,nullable = false)
|
||||
|
||||
/** 关键字 */
|
||||
@TableField(value = "`key`")
|
||||
private String key;
|
||||
|
||||
// 回复类型
|
||||
@Column(name = "type",nullable = false)
|
||||
|
||||
/** 回复类型 */
|
||||
private String type;
|
||||
|
||||
// 回复数据
|
||||
@Column(name = "data",nullable = false)
|
||||
|
||||
/** 回复数据 */
|
||||
private String data;
|
||||
|
||||
// 0=不可用 1 =可用
|
||||
@Column(name = "status",nullable = false)
|
||||
|
||||
/** 0=不可用 1 =可用 */
|
||||
private Integer status;
|
||||
|
||||
// 是否隐藏
|
||||
@Column(name = "hide",nullable = false)
|
||||
|
||||
/** 是否隐藏 */
|
||||
private Integer hide;
|
||||
|
||||
|
||||
public void copy(YxWechatReply source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,51 +1,60 @@
|
||||
package co.yixiang.mp.domain;
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.domain;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author xuwenbo
|
||||
* @date 2019-12-10
|
||||
* @author hupeng
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="yx_wechat_template")
|
||||
@TableName("yx_wechat_template")
|
||||
public class YxWechatTemplate implements Serializable {
|
||||
|
||||
// 模板id
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
/** 模板id */
|
||||
@TableId
|
||||
private Integer id;
|
||||
|
||||
// 模板编号
|
||||
@Column(name = "tempkey",nullable = false)
|
||||
|
||||
/** 模板编号 */
|
||||
private String tempkey;
|
||||
|
||||
// 模板名
|
||||
@Column(name = "name",nullable = false)
|
||||
|
||||
/** 模板名 */
|
||||
private String name;
|
||||
|
||||
// 回复内容
|
||||
@Column(name = "content",nullable = false)
|
||||
|
||||
/** 回复内容 */
|
||||
private String content;
|
||||
|
||||
// 模板ID
|
||||
@Column(name = "tempid")
|
||||
|
||||
/** 模板ID */
|
||||
private String tempid;
|
||||
|
||||
// 添加时间
|
||||
@Column(name = "add_time",nullable = false)
|
||||
|
||||
/** 添加时间 */
|
||||
@TableField(fill= FieldFill.INSERT)
|
||||
private String addTime;
|
||||
|
||||
// 状态
|
||||
@Column(name = "status",nullable = false)
|
||||
|
||||
/** 状态 */
|
||||
private Integer status;
|
||||
|
||||
|
||||
public void copy(YxWechatTemplate source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.error;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.error;
|
||||
|
||||
import org.springframework.boot.web.server.ErrorPage;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.handler;
|
||||
|
||||
import me.chanjar.weixin.mp.api.WxMpMessageHandler;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.handler;
|
||||
|
||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.handler;
|
||||
|
||||
import co.yixiang.mp.builder.TextBuilder;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.handler;
|
||||
|
||||
import co.yixiang.mp.utils.JsonUtils;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.handler;
|
||||
|
||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.handler;
|
||||
|
||||
import co.yixiang.mp.builder.TextBuilder;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.handler;
|
||||
|
||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.handler;
|
||||
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.handler;
|
||||
|
||||
import java.util.Map;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.handler;
|
||||
|
||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.handler;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.handler;
|
||||
|
||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||
|
@ -1,13 +0,0 @@
|
||||
package co.yixiang.mp.repository;
|
||||
|
||||
|
||||
import co.yixiang.mp.domain.YxArticle;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-07
|
||||
*/
|
||||
public interface YxArticleRepository extends JpaRepository<YxArticle, Integer>, JpaSpecificationExecutor {
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package co.yixiang.mp.repository;
|
||||
|
||||
|
||||
import co.yixiang.mp.domain.YxWechatMenu;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
public interface YxWechatMenuRepository extends JpaRepository<YxWechatMenu, String>, JpaSpecificationExecutor {
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package co.yixiang.mp.repository;
|
||||
|
||||
import co.yixiang.mp.domain.YxWechatReply;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-10
|
||||
*/
|
||||
public interface YxWechatReplyRepository extends JpaRepository<YxWechatReply, Integer>, JpaSpecificationExecutor {
|
||||
|
||||
/**
|
||||
* findByKey
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
YxWechatReply findByKey(String key);
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package co.yixiang.mp.repository;
|
||||
|
||||
import co.yixiang.mp.domain.YxWechatTemplate;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @author xuwenbo
|
||||
* @date 2019-12-10
|
||||
*/
|
||||
public interface YxWechatTemplateRepository extends JpaRepository<YxWechatTemplate, Integer>, JpaSpecificationExecutor {
|
||||
YxWechatTemplate findByTempkey(String key);
|
||||
}
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
@ -1,68 +1,48 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service;
|
||||
|
||||
|
||||
import co.yixiang.common.service.BaseService;
|
||||
import co.yixiang.mp.domain.YxArticle;
|
||||
import co.yixiang.mp.service.dto.YxArticleDTO;
|
||||
import co.yixiang.mp.service.dto.YxArticleDto;
|
||||
import co.yixiang.mp.service.dto.YxArticleQueryCriteria;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-07
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
//@CacheConfig(cacheNames = "yxArticle")
|
||||
public interface YxArticleService {
|
||||
public interface YxArticleService extends BaseService<YxArticle>{
|
||||
|
||||
/**
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria
|
||||
* @param pageable
|
||||
* @return
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
//@Cacheable
|
||||
Map<String,Object> queryAll(YxArticleQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria
|
||||
* @return
|
||||
* @param criteria 条件参数
|
||||
* @return List<YxArticleDto>
|
||||
*/
|
||||
//@Cacheable
|
||||
List<YxArticleDTO> queryAll(YxArticleQueryCriteria criteria);
|
||||
List<YxArticle> queryAll(YxArticleQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(key = "#p0")
|
||||
YxArticleDTO findById(Integer id);
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<YxArticleDto> all, HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources
|
||||
* @return
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
YxArticleDTO create(YxArticle resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void update(YxArticle resources);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void delete(Integer id);
|
||||
|
||||
void uploadNews(YxArticleDTO yxArticleDTO) throws Exception;
|
||||
|
||||
}
|
||||
void uploadNews(YxArticleDto yxArticleDTO) throws WxErrorException;
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service;
|
||||
|
||||
import co.yixiang.mp.domain.YxWechatTemplate;
|
||||
|
@ -1,67 +1,47 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service;
|
||||
|
||||
|
||||
import co.yixiang.common.service.BaseService;
|
||||
import co.yixiang.mp.domain.YxWechatMenu;
|
||||
import co.yixiang.mp.service.dto.YxWechatMenuDTO;
|
||||
import co.yixiang.mp.service.dto.YxWechatMenuDto;
|
||||
import co.yixiang.mp.service.dto.YxWechatMenuQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-06
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
//@CacheConfig(cacheNames = "YxWechatMenu")
|
||||
public interface YxWechatMenuService {
|
||||
public interface YxWechatMenuService extends BaseService<YxWechatMenu>{
|
||||
|
||||
/**
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria
|
||||
* @param pageable
|
||||
* @return
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
//@Cacheable
|
||||
Map<String,Object> queryAll(YxWechatMenuQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria
|
||||
* @return
|
||||
* @param criteria 条件参数
|
||||
* @return List<YxWechatMenuDto>
|
||||
*/
|
||||
//@Cacheable
|
||||
List<YxWechatMenuDTO> queryAll(YxWechatMenuQueryCriteria criteria);
|
||||
List<YxWechatMenu> queryAll(YxWechatMenuQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(key = "#p0")
|
||||
YxWechatMenuDTO findById(String key);
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<YxWechatMenuDto> all, HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources
|
||||
* @return
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
YxWechatMenuDTO create(YxWechatMenu resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void update(YxWechatMenu resources);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param key
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void delete(String key);
|
||||
|
||||
boolean isExist(String key);
|
||||
}
|
||||
Boolean isExist(String wechat_menus);
|
||||
}
|
||||
|
@ -1,68 +1,51 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service;
|
||||
|
||||
|
||||
import co.yixiang.common.service.BaseService;
|
||||
import co.yixiang.mp.domain.YxWechatReply;
|
||||
import co.yixiang.mp.service.dto.YxWechatReplyDTO;
|
||||
import co.yixiang.mp.service.dto.YxWechatReplyDto;
|
||||
import co.yixiang.mp.service.dto.YxWechatReplyQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-10
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
//@CacheConfig(cacheNames = "yxWechatReply")
|
||||
public interface YxWechatReplyService {
|
||||
public interface YxWechatReplyService extends BaseService<YxWechatReply>{
|
||||
|
||||
/**
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria
|
||||
* @param pageable
|
||||
* @return
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
//@Cacheable
|
||||
Map<String,Object> queryAll(YxWechatReplyQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria
|
||||
* @return
|
||||
* @param criteria 条件参数
|
||||
* @return List<YxWechatReplyDto>
|
||||
*/
|
||||
//@Cacheable
|
||||
List<YxWechatReplyDTO> queryAll(YxWechatReplyQueryCriteria criteria);
|
||||
List<YxWechatReply> queryAll(YxWechatReplyQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(key = "#p0")
|
||||
YxWechatReplyDTO findById(Integer id);
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<YxWechatReplyDto> all, HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources
|
||||
* @return
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
YxWechatReplyDTO create(YxWechatReply resources);
|
||||
YxWechatReply isExist(String subscribe);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void update(YxWechatReply resources);
|
||||
void create(YxWechatReply yxWechatReply);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void delete(Integer id);
|
||||
|
||||
YxWechatReply isExist(String key);
|
||||
|
||||
}
|
||||
void upDate(YxWechatReply yxWechatReply);
|
||||
}
|
||||
|
@ -1,66 +1,47 @@
|
||||
package co.yixiang.mp.service;
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service;
|
||||
import co.yixiang.common.service.BaseService;
|
||||
import co.yixiang.mp.domain.YxWechatTemplate;
|
||||
import co.yixiang.mp.service.dto.YxWechatTemplateDTO;
|
||||
import co.yixiang.mp.service.dto.YxWechatTemplateDto;
|
||||
import co.yixiang.mp.service.dto.YxWechatTemplateQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author xuwenbo
|
||||
* @date 2019-12-10
|
||||
* @author hupeng
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
//@CacheConfig(cacheNames = "yxWechatTemplate")
|
||||
public interface YxWechatTemplateService {
|
||||
public interface YxWechatTemplateService extends BaseService<YxWechatTemplate>{
|
||||
|
||||
YxWechatTemplate findByTempkey(String key);
|
||||
|
||||
/**
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria
|
||||
* @param pageable
|
||||
* @return
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
//@Cacheable
|
||||
Map<String,Object> queryAll(YxWechatTemplateQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria
|
||||
* @return
|
||||
* @param criteria 条件参数
|
||||
* @return List<YxWechatTemplateDto>
|
||||
*/
|
||||
//@Cacheable
|
||||
List<YxWechatTemplateDTO> queryAll(YxWechatTemplateQueryCriteria criteria);
|
||||
List<YxWechatTemplate> queryAll(YxWechatTemplateQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(key = "#p0")
|
||||
YxWechatTemplateDTO findById(Integer id);
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<YxWechatTemplateDto> all, HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources
|
||||
* @return
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
YxWechatTemplateDTO create(YxWechatTemplate resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void update(YxWechatTemplate resources);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void delete(Integer id);
|
||||
}
|
||||
YxWechatTemplate findByTempkey(String recharge_success_key);
|
||||
}
|
||||
|
@ -1,75 +1,78 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-07
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Data
|
||||
public class YxArticleDTO implements Serializable {
|
||||
public class YxArticleDto implements Serializable {
|
||||
|
||||
// 文章管理ID
|
||||
/** 文章管理ID */
|
||||
private Integer id;
|
||||
|
||||
// 分类id
|
||||
/** 分类id */
|
||||
private String cid;
|
||||
|
||||
// 文章标题
|
||||
/** 文章标题 */
|
||||
private String title;
|
||||
|
||||
// 文章作者
|
||||
/** 文章作者 */
|
||||
private String author;
|
||||
|
||||
// 文章图片
|
||||
/** 文章图片 */
|
||||
private String imageInput;
|
||||
|
||||
// 文章简介
|
||||
/** 文章简介 */
|
||||
private String synopsis;
|
||||
|
||||
private String content;
|
||||
|
||||
// 文章分享标题
|
||||
/** 文章分享标题 */
|
||||
private String shareTitle;
|
||||
|
||||
// 文章分享简介
|
||||
/** 文章分享简介 */
|
||||
private String shareSynopsis;
|
||||
|
||||
// 浏览次数
|
||||
/** 浏览次数 */
|
||||
private String visit;
|
||||
|
||||
// 排序
|
||||
/** 排序 */
|
||||
private Integer sort;
|
||||
|
||||
// 原文链接
|
||||
/** 原文链接 */
|
||||
private String url;
|
||||
|
||||
// 状态
|
||||
/** 状态 */
|
||||
private Integer status;
|
||||
|
||||
// 添加时间
|
||||
/** 添加时间 */
|
||||
private String addTime;
|
||||
|
||||
// 是否隐藏
|
||||
/** 是否隐藏 */
|
||||
private Integer hide;
|
||||
|
||||
// 管理员id
|
||||
/** 管理员id */
|
||||
private Integer adminId;
|
||||
|
||||
// 商户id
|
||||
/** 商户id */
|
||||
private Integer merId;
|
||||
|
||||
// 产品关联id
|
||||
/** 产品关联id */
|
||||
private Integer productId;
|
||||
|
||||
// 是否热门(小程序)
|
||||
/** 是否热门(小程序) */
|
||||
private Integer isHot;
|
||||
|
||||
// 是否轮播图(小程序)
|
||||
/** 是否轮播图(小程序) */
|
||||
private Integer isBanner;
|
||||
|
||||
private String thumbMediaId;
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,18 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
import co.yixiang.annotation.Query;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-07
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Data
|
||||
public class YxArticleQueryCriteria{
|
||||
}
|
||||
}
|
||||
|
@ -1,22 +1,25 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-06
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Data
|
||||
public class YxWechatMenuDTO implements Serializable {
|
||||
public class YxWechatMenuDto implements Serializable {
|
||||
|
||||
private String key;
|
||||
|
||||
// 缓存数据
|
||||
/** 缓存数据 */
|
||||
private String result;
|
||||
|
||||
// 缓存时间
|
||||
/** 缓存时间 */
|
||||
private Integer addTime;
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,18 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
import co.yixiang.annotation.Query;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-06
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Data
|
||||
public class YxWechatMenuQueryCriteria{
|
||||
}
|
||||
}
|
||||
|
@ -1,32 +1,35 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-10
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Data
|
||||
public class YxWechatReplyDTO implements Serializable {
|
||||
public class YxWechatReplyDto implements Serializable {
|
||||
|
||||
// 微信关键字回复id
|
||||
/** 微信关键字回复id */
|
||||
private Integer id;
|
||||
|
||||
// 关键字
|
||||
/** 关键字 */
|
||||
private String key;
|
||||
|
||||
// 回复类型
|
||||
/** 回复类型 */
|
||||
private String type;
|
||||
|
||||
// 回复数据
|
||||
/** 回复数据 */
|
||||
private String data;
|
||||
|
||||
// 0=不可用 1 =可用
|
||||
/** 0=不可用 1 =可用 */
|
||||
private Integer status;
|
||||
|
||||
// 是否隐藏
|
||||
/** 是否隐藏 */
|
||||
private Integer hide;
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,18 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
import co.yixiang.annotation.Query;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-10
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Data
|
||||
public class YxWechatReplyQueryCriteria{
|
||||
}
|
||||
}
|
||||
|
@ -1,34 +1,38 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @author xuwenbo
|
||||
* @date 2019-12-10
|
||||
* @author hupeng
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Data
|
||||
public class YxWechatTemplateDTO implements Serializable {
|
||||
public class YxWechatTemplateDto implements Serializable {
|
||||
|
||||
// 模板id
|
||||
/** 模板id */
|
||||
private Integer id;
|
||||
|
||||
// 模板编号
|
||||
/** 模板编号 */
|
||||
private String tempkey;
|
||||
|
||||
// 模板名
|
||||
/** 模板名 */
|
||||
private String name;
|
||||
|
||||
// 回复内容
|
||||
/** 回复内容 */
|
||||
private String content;
|
||||
|
||||
// 模板ID
|
||||
/** 模板ID */
|
||||
private String tempid;
|
||||
|
||||
// 添加时间
|
||||
/** 添加时间 */
|
||||
private String addTime;
|
||||
|
||||
// 状态
|
||||
/** 状态 */
|
||||
private Integer status;
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,18 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
import co.yixiang.annotation.Query;
|
||||
|
||||
/**
|
||||
* @author xuwenbo
|
||||
* @date 2019-12-10
|
||||
* @author hupeng
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Data
|
||||
public class YxWechatTemplateQueryCriteria{
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
@ -1,22 +1,26 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.ReUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import co.yixiang.exception.BadRequestException;
|
||||
import co.yixiang.exception.ErrorRequestException;
|
||||
import co.yixiang.mp.config.WxMpConfiguration;
|
||||
import co.yixiang.mp.domain.YxArticle;
|
||||
import co.yixiang.mp.repository.YxArticleRepository;
|
||||
import co.yixiang.mp.service.YxArticleService;
|
||||
import co.yixiang.mp.service.dto.YxArticleDTO;
|
||||
import co.yixiang.mp.service.dto.YxArticleQueryCriteria;
|
||||
import co.yixiang.mp.service.mapper.YxArticleMapper;
|
||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||
import co.yixiang.mp.utils.URLUtils;
|
||||
import co.yixiang.utils.*;
|
||||
import co.yixiang.dozer.service.IGenerator;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import co.yixiang.common.utils.QueryHelpPlus;
|
||||
import co.yixiang.utils.FileUtil;
|
||||
import co.yixiang.mp.service.YxArticleService;
|
||||
import co.yixiang.mp.service.dto.YxArticleDto;
|
||||
import co.yixiang.mp.service.dto.YxArticleQueryCriteria;
|
||||
import co.yixiang.mp.service.mapper.ArticleMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
@ -29,82 +33,91 @@ import me.chanjar.weixin.mp.bean.material.WxMpMaterialUploadResult;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpMassSendResult;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
// 默认不使用缓存
|
||||
//import org.springframework.cache.annotation.CacheConfig;
|
||||
//import org.springframework.cache.annotation.CacheEvict;
|
||||
//import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-07
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
//@CacheConfig(cacheNames = "yxArticle")
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class YxArticleServiceImpl implements YxArticleService {
|
||||
|
||||
private final YxArticleRepository yxArticleRepository;
|
||||
|
||||
private final YxArticleMapper yxArticleMapper;
|
||||
|
||||
public YxArticleServiceImpl(YxArticleRepository yxArticleRepository, YxArticleMapper yxArticleMapper) {
|
||||
this.yxArticleRepository = yxArticleRepository;
|
||||
this.yxArticleMapper = yxArticleMapper;
|
||||
}
|
||||
public class YxArticleServiceImpl extends BaseServiceImpl<ArticleMapper, YxArticle> implements YxArticleService {
|
||||
|
||||
private final IGenerator generator;
|
||||
@Value("${file.path}")
|
||||
private String uploadDirStr;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(YxArticleQueryCriteria criteria, Pageable pageable){
|
||||
Page<YxArticle> page = yxArticleRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(yxArticleMapper::toDto));
|
||||
public YxArticleServiceImpl(IGenerator generator) {
|
||||
this.generator = generator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<YxArticleDTO> queryAll(YxArticleQueryCriteria criteria){
|
||||
return yxArticleMapper.toDto(yxArticleRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public YxArticleDTO findById(Integer id) {
|
||||
Optional<YxArticle> yxArticle = yxArticleRepository.findById(id);
|
||||
ValidationUtil.isNull(yxArticle,"YxArticle","id",id);
|
||||
return yxArticleMapper.toDto(yxArticle.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public YxArticleDTO create(YxArticle resources) {
|
||||
//resources.setAddTime(String.valueOf(OrderUtil.getSecondTimestampTwo()));
|
||||
return yxArticleMapper.toDto(yxArticleRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(YxArticle resources) {
|
||||
Optional<YxArticle> optionalYxArticle = yxArticleRepository.findById(resources.getId());
|
||||
ValidationUtil.isNull( optionalYxArticle,"YxArticle","id",resources.getId());
|
||||
YxArticle yxArticle = optionalYxArticle.get();
|
||||
yxArticle.copy(resources);
|
||||
yxArticleRepository.save(yxArticle);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Integer id) {
|
||||
yxArticleRepository.deleteById(id);
|
||||
//@Cacheable
|
||||
public Map<String, Object> queryAll(YxArticleQueryCriteria criteria, Pageable pageable) {
|
||||
getPage(pageable);
|
||||
PageInfo<YxArticle> page = new PageInfo<>(queryAll(criteria));
|
||||
Map<String, Object> map = new LinkedHashMap<>(2);
|
||||
map.put("content", generator.convert(page.getList(), YxArticleDto.class));
|
||||
map.put("totalElements", page.getTotal());
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void uploadNews(YxArticleDTO wxNewsArticleItem) throws Exception {
|
||||
//@Cacheable
|
||||
public List<YxArticle> queryAll(YxArticleQueryCriteria criteria){
|
||||
return baseMapper.selectList(QueryHelpPlus.getPredicate(YxArticle.class, criteria));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void download(List<YxArticleDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (YxArticleDto yxArticle : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("分类id", yxArticle.getCid());
|
||||
map.put("文章标题", yxArticle.getTitle());
|
||||
map.put("文章作者", yxArticle.getAuthor());
|
||||
map.put("文章图片", yxArticle.getImageInput());
|
||||
map.put("文章简介", yxArticle.getSynopsis());
|
||||
map.put(" content", yxArticle.getContent());
|
||||
map.put("文章分享标题", yxArticle.getShareTitle());
|
||||
map.put("文章分享简介", yxArticle.getShareSynopsis());
|
||||
map.put("浏览次数", yxArticle.getVisit());
|
||||
map.put("排序", yxArticle.getSort());
|
||||
map.put("原文链接", yxArticle.getUrl());
|
||||
map.put("状态", yxArticle.getStatus());
|
||||
map.put("添加时间", yxArticle.getAddTime());
|
||||
map.put("是否隐藏", yxArticle.getHide());
|
||||
map.put("管理员id", yxArticle.getAdminId());
|
||||
map.put("商户id", yxArticle.getMerId());
|
||||
map.put("产品关联id", yxArticle.getProductId());
|
||||
map.put("是否热门(小程序)", yxArticle.getIsHot());
|
||||
map.put("是否轮播图(小程序)", yxArticle.getIsBanner());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadNews(YxArticleDto wxNewsArticleItem) throws WxErrorException {
|
||||
|
||||
WxMpService wxMpService = WxMpConfiguration.getWxMpService();
|
||||
|
||||
@ -161,9 +174,9 @@ public class YxArticleServiceImpl implements YxArticleService {
|
||||
private WxMpMaterialUploadResult uploadPhotoToWx(WxMpService wxMpService, String picPath) throws WxErrorException {
|
||||
WxMpMaterial wxMpMaterial = new WxMpMaterial();
|
||||
|
||||
String filename = String.valueOf( System.currentTimeMillis() ) + ".png";
|
||||
String filename = String.valueOf( (int)System.currentTimeMillis() ) + ".png";
|
||||
String downloadPath = uploadDirStr + filename;
|
||||
long size = HttpUtil.downloadFile(picPath, FileUtil.file(downloadPath));
|
||||
long size = HttpUtil.downloadFile(picPath, cn.hutool.core.io.FileUtil.file(downloadPath));
|
||||
picPath = downloadPath;
|
||||
File picFile = new File( picPath );
|
||||
wxMpMaterial.setFile( picFile );
|
||||
@ -187,7 +200,7 @@ public class YxArticleServiceImpl implements YxArticleService {
|
||||
if(StringUtils.isBlank( filepath )){//网络图片URL,需下载到本地
|
||||
String filename = String.valueOf( System.currentTimeMillis() ) + ".png";
|
||||
String downloadPath = uploadDirStr + filename;
|
||||
long size = HttpUtil.downloadFile(imgSrc, FileUtil.file(downloadPath));
|
||||
long size = HttpUtil.downloadFile(imgSrc, cn.hutool.core.io.FileUtil.file(downloadPath));
|
||||
filepath = downloadPath;
|
||||
}
|
||||
WxMediaImgUploadResult wxMediaImgUploadResult = wxMpService.getMaterialService().mediaImgUpload( new File(filepath) );
|
||||
@ -195,4 +208,4 @@ public class YxArticleServiceImpl implements YxArticleService {
|
||||
}
|
||||
return content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,89 +1,84 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service.impl;
|
||||
|
||||
|
||||
import co.yixiang.mp.domain.YxWechatMenu;
|
||||
import co.yixiang.mp.repository.YxWechatMenuRepository;
|
||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import co.yixiang.dozer.service.IGenerator;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import co.yixiang.common.utils.QueryHelpPlus;
|
||||
import co.yixiang.utils.FileUtil;
|
||||
import co.yixiang.mp.service.YxWechatMenuService;
|
||||
import co.yixiang.mp.service.dto.YxWechatMenuDTO;
|
||||
import co.yixiang.mp.service.dto.YxWechatMenuDto;
|
||||
import co.yixiang.mp.service.dto.YxWechatMenuQueryCriteria;
|
||||
import co.yixiang.mp.service.mapper.YxWechatMenuMapper;
|
||||
import co.yixiang.utils.PageUtil;
|
||||
import co.yixiang.utils.QueryHelp;
|
||||
import co.yixiang.utils.ValidationUtil;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import co.yixiang.mp.service.mapper.WechatMenuMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
// 默认不使用缓存
|
||||
//import org.springframework.cache.annotation.CacheConfig;
|
||||
//import org.springframework.cache.annotation.CacheEvict;
|
||||
//import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-06
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
//@CacheConfig(cacheNames = "yxWechatMenu")
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class YxWechatMenuServiceImpl implements YxWechatMenuService {
|
||||
public class YxWechatMenuServiceImpl extends BaseServiceImpl<WechatMenuMapper, YxWechatMenu> implements YxWechatMenuService {
|
||||
|
||||
private final YxWechatMenuRepository YxWechatMenuRepository;
|
||||
private final IGenerator generator;
|
||||
|
||||
private final YxWechatMenuMapper YxWechatMenuMapper;
|
||||
@Override
|
||||
//@Cacheable
|
||||
public Map<String, Object> queryAll(YxWechatMenuQueryCriteria criteria, Pageable pageable) {
|
||||
getPage(pageable);
|
||||
PageInfo<YxWechatMenu> page = new PageInfo<>(queryAll(criteria));
|
||||
Map<String, Object> map = new LinkedHashMap<>(2);
|
||||
map.put("content", generator.convert(page.getList(), YxWechatMenuDto.class));
|
||||
map.put("totalElements", page.getTotal());
|
||||
return map;
|
||||
}
|
||||
|
||||
public YxWechatMenuServiceImpl(YxWechatMenuRepository YxWechatMenuRepository, YxWechatMenuMapper YxWechatMenuMapper) {
|
||||
this.YxWechatMenuRepository = YxWechatMenuRepository;
|
||||
this.YxWechatMenuMapper = YxWechatMenuMapper;
|
||||
|
||||
@Override
|
||||
//@Cacheable
|
||||
public List<YxWechatMenu> queryAll(YxWechatMenuQueryCriteria criteria){
|
||||
return baseMapper.selectList(QueryHelpPlus.getPredicate(YxWechatMenu.class, criteria));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void download(List<YxWechatMenuDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (YxWechatMenuDto yxWechatMenu : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("缓存数据", yxWechatMenu.getResult());
|
||||
map.put("缓存时间", yxWechatMenu.getAddTime());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(YxWechatMenuQueryCriteria criteria, Pageable pageable){
|
||||
Page<YxWechatMenu> page = YxWechatMenuRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(YxWechatMenuMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<YxWechatMenuDTO> queryAll(YxWechatMenuQueryCriteria criteria){
|
||||
return YxWechatMenuMapper.toDto(YxWechatMenuRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public YxWechatMenuDTO findById(String key) {
|
||||
Optional<YxWechatMenu> YxWechatMenu = YxWechatMenuRepository.findById(key);
|
||||
ValidationUtil.isNull(YxWechatMenu,"YxWechatMenu","key",key);
|
||||
return YxWechatMenuMapper.toDto(YxWechatMenu.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isExist(String key) {
|
||||
Optional<YxWechatMenu> YxWechatMenu = YxWechatMenuRepository.findById(key);
|
||||
if(!YxWechatMenu.isPresent()){
|
||||
public Boolean isExist(String wechat_menus) {
|
||||
YxWechatMenu yxWechatMenu = this.getOne(new QueryWrapper<YxWechatMenu>().eq("`key`",wechat_menus));
|
||||
if(yxWechatMenu == null){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public YxWechatMenuDTO create(YxWechatMenu resources) {
|
||||
//resources.setKey(IdUtil.simpleUUID());
|
||||
return YxWechatMenuMapper.toDto(YxWechatMenuRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(YxWechatMenu resources) {
|
||||
Optional<YxWechatMenu> optionalYxWechatMenu = YxWechatMenuRepository.findById(resources.getKey());
|
||||
ValidationUtil.isNull( optionalYxWechatMenu,"YxWechatMenu","id",resources.getKey());
|
||||
YxWechatMenu YxWechatMenu = optionalYxWechatMenu.get();
|
||||
YxWechatMenu.copy(resources);
|
||||
YxWechatMenuRepository.save(YxWechatMenu);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(String key) {
|
||||
YxWechatMenuRepository.deleteById(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,95 +1,105 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service.impl;
|
||||
|
||||
import co.yixiang.exception.EntityExistException;
|
||||
import co.yixiang.mp.domain.YxWechatReply;
|
||||
import co.yixiang.mp.repository.YxWechatReplyRepository;
|
||||
import co.yixiang.exception.EntityExistException;
|
||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import co.yixiang.dozer.service.IGenerator;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import co.yixiang.common.utils.QueryHelpPlus;
|
||||
import co.yixiang.utils.FileUtil;
|
||||
import co.yixiang.mp.service.YxWechatReplyService;
|
||||
import co.yixiang.mp.service.dto.YxWechatReplyDTO;
|
||||
import co.yixiang.mp.service.dto.YxWechatReplyDto;
|
||||
import co.yixiang.mp.service.dto.YxWechatReplyQueryCriteria;
|
||||
import co.yixiang.mp.service.mapper.YxWechatReplyMapper;
|
||||
import co.yixiang.utils.PageUtil;
|
||||
import co.yixiang.utils.QueryHelp;
|
||||
import co.yixiang.utils.ValidationUtil;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import co.yixiang.mp.service.mapper.WechatReplyMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
// 默认不使用缓存
|
||||
//import org.springframework.cache.annotation.CacheConfig;
|
||||
//import org.springframework.cache.annotation.CacheEvict;
|
||||
//import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-10
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
//@CacheConfig(cacheNames = "yxWechatReply")
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class YxWechatReplyServiceImpl implements YxWechatReplyService {
|
||||
public class YxWechatReplyServiceImpl extends BaseServiceImpl<WechatReplyMapper, YxWechatReply> implements YxWechatReplyService {
|
||||
|
||||
private final YxWechatReplyRepository yxWechatReplyRepository;
|
||||
|
||||
private final YxWechatReplyMapper yxWechatReplyMapper;
|
||||
|
||||
public YxWechatReplyServiceImpl(YxWechatReplyRepository yxWechatReplyRepository, YxWechatReplyMapper yxWechatReplyMapper) {
|
||||
this.yxWechatReplyRepository = yxWechatReplyRepository;
|
||||
this.yxWechatReplyMapper = yxWechatReplyMapper;
|
||||
}
|
||||
private final IGenerator generator;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(YxWechatReplyQueryCriteria criteria, Pageable pageable){
|
||||
Page<YxWechatReply> page = yxWechatReplyRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(yxWechatReplyMapper::toDto));
|
||||
//@Cacheable
|
||||
public Map<String, Object> queryAll(YxWechatReplyQueryCriteria criteria, Pageable pageable) {
|
||||
getPage(pageable);
|
||||
PageInfo<YxWechatReply> page = new PageInfo<>(queryAll(criteria));
|
||||
Map<String, Object> map = new LinkedHashMap<>(2);
|
||||
map.put("content", generator.convert(page.getList(), YxWechatReplyDto.class));
|
||||
map.put("totalElements", page.getTotal());
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<YxWechatReplyDTO> queryAll(YxWechatReplyQueryCriteria criteria){
|
||||
return yxWechatReplyMapper.toDto(yxWechatReplyRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public YxWechatReplyDTO findById(Integer id) {
|
||||
Optional<YxWechatReply> yxWechatReply = yxWechatReplyRepository.findById(id);
|
||||
ValidationUtil.isNull(yxWechatReply,"YxWechatReply","id",id);
|
||||
return yxWechatReplyMapper.toDto(yxWechatReply.get());
|
||||
//@Cacheable
|
||||
public List<YxWechatReply> queryAll(YxWechatReplyQueryCriteria criteria){
|
||||
return baseMapper.selectList(QueryHelpPlus.getPredicate(YxWechatReply.class, criteria));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public YxWechatReplyDTO create(YxWechatReply resources) {
|
||||
if(yxWechatReplyRepository.findByKey(resources.getKey()) != null){
|
||||
throw new EntityExistException(YxWechatReply.class,"key",resources.getKey());
|
||||
public void download(List<YxWechatReplyDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (YxWechatReplyDto yxWechatReply : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("关键字", yxWechatReply.getKey());
|
||||
map.put("回复类型", yxWechatReply.getType());
|
||||
map.put("回复数据", yxWechatReply.getData());
|
||||
map.put("0=不可用 1 =可用", yxWechatReply.getStatus());
|
||||
map.put("是否隐藏", yxWechatReply.getHide());
|
||||
list.add(map);
|
||||
}
|
||||
return yxWechatReplyMapper.toDto(yxWechatReplyRepository.save(resources));
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(YxWechatReply resources) {
|
||||
Optional<YxWechatReply> optionalYxWechatReply = yxWechatReplyRepository.findById(resources.getId());
|
||||
ValidationUtil.isNull( optionalYxWechatReply,"YxWechatReply","id",resources.getId());
|
||||
YxWechatReply yxWechatReply = optionalYxWechatReply.get();
|
||||
public YxWechatReply isExist(String key) {
|
||||
YxWechatReply yxWechatReply = this.getOne(new QueryWrapper<YxWechatReply>().eq("`key`",key));
|
||||
return yxWechatReply;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(YxWechatReply yxWechatReply) {
|
||||
if(this.isExist(yxWechatReply.getKey()) != null){
|
||||
throw new EntityExistException(YxWechatReply.class,"key",yxWechatReply.getKey());
|
||||
}
|
||||
this.save(yxWechatReply);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upDate(YxWechatReply resources) {
|
||||
YxWechatReply yxWechatReply = this.getById(resources.getId());
|
||||
YxWechatReply yxWechatReply1 = null;
|
||||
yxWechatReply1 = yxWechatReplyRepository.findByKey(resources.getKey());
|
||||
yxWechatReply1 = this.isExist(resources.getKey());
|
||||
if(yxWechatReply1 != null && !yxWechatReply1.getId().equals(yxWechatReply.getId())){
|
||||
throw new EntityExistException(YxWechatReply.class,"key",resources.getKey());
|
||||
}
|
||||
yxWechatReply.copy(resources);
|
||||
yxWechatReplyRepository.save(yxWechatReply);
|
||||
this.saveOrUpdate(yxWechatReply);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Integer id) {
|
||||
yxWechatReplyRepository.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public YxWechatReply isExist(String key) {
|
||||
YxWechatReply yxWechatReply = yxWechatReplyRepository.findByKey(key);
|
||||
|
||||
return yxWechatReply;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,83 +1,87 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service.impl;
|
||||
|
||||
import co.yixiang.mp.domain.YxWechatTemplate;
|
||||
import co.yixiang.utils.ValidationUtil;
|
||||
import co.yixiang.mp.repository.YxWechatTemplateRepository;
|
||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import co.yixiang.dozer.service.IGenerator;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import co.yixiang.common.utils.QueryHelpPlus;
|
||||
import co.yixiang.utils.FileUtil;
|
||||
import co.yixiang.mp.service.YxWechatTemplateService;
|
||||
import co.yixiang.mp.service.dto.YxWechatTemplateDTO;
|
||||
import co.yixiang.mp.service.dto.YxWechatTemplateDto;
|
||||
import co.yixiang.mp.service.dto.YxWechatTemplateQueryCriteria;
|
||||
import co.yixiang.mp.service.mapper.YxWechatTemplateMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import co.yixiang.mp.service.mapper.WechatTemplateMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.Optional;
|
||||
import org.springframework.data.domain.Page;
|
||||
// 默认不使用缓存
|
||||
//import org.springframework.cache.annotation.CacheConfig;
|
||||
//import org.springframework.cache.annotation.CacheEvict;
|
||||
//import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import co.yixiang.utils.PageUtil;
|
||||
import co.yixiang.utils.QueryHelp;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @author xuwenbo
|
||||
* @date 2019-12-10
|
||||
* @author hupeng
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
//@CacheConfig(cacheNames = "yxWechatTemplate")
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class YxWechatTemplateServiceImpl implements YxWechatTemplateService {
|
||||
public class YxWechatTemplateServiceImpl extends BaseServiceImpl<WechatTemplateMapper, YxWechatTemplate> implements YxWechatTemplateService {
|
||||
|
||||
private final YxWechatTemplateRepository yxWechatTemplateRepository;
|
||||
private final IGenerator generator;
|
||||
|
||||
private final YxWechatTemplateMapper yxWechatTemplateMapper;
|
||||
@Override
|
||||
//@Cacheable
|
||||
public Map<String, Object> queryAll(YxWechatTemplateQueryCriteria criteria, Pageable pageable) {
|
||||
getPage(pageable);
|
||||
PageInfo<YxWechatTemplate> page = new PageInfo<>(queryAll(criteria));
|
||||
Map<String, Object> map = new LinkedHashMap<>(2);
|
||||
map.put("content", generator.convert(page.getList(), YxWechatTemplateDto.class));
|
||||
map.put("totalElements", page.getTotal());
|
||||
return map;
|
||||
}
|
||||
|
||||
public YxWechatTemplateServiceImpl(YxWechatTemplateRepository yxWechatTemplateRepository, YxWechatTemplateMapper yxWechatTemplateMapper) {
|
||||
this.yxWechatTemplateRepository = yxWechatTemplateRepository;
|
||||
this.yxWechatTemplateMapper = yxWechatTemplateMapper;
|
||||
|
||||
@Override
|
||||
//@Cacheable
|
||||
public List<YxWechatTemplate> queryAll(YxWechatTemplateQueryCriteria criteria){
|
||||
return baseMapper.selectList(QueryHelpPlus.getPredicate(YxWechatTemplate.class, criteria));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void download(List<YxWechatTemplateDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (YxWechatTemplateDto yxWechatTemplate : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("模板编号", yxWechatTemplate.getTempkey());
|
||||
map.put("模板名", yxWechatTemplate.getName());
|
||||
map.put("回复内容", yxWechatTemplate.getContent());
|
||||
map.put("模板ID", yxWechatTemplate.getTempid());
|
||||
map.put("添加时间", yxWechatTemplate.getAddTime());
|
||||
map.put("状态", yxWechatTemplate.getStatus());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public YxWechatTemplate findByTempkey(String key) {
|
||||
return yxWechatTemplateRepository.findByTempkey(key);
|
||||
public YxWechatTemplate findByTempkey(String recharge_success_key) {
|
||||
return this.getOne(new QueryWrapper<YxWechatTemplate>().eq("tempkey",recharge_success_key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(YxWechatTemplateQueryCriteria criteria, Pageable pageable){
|
||||
Page<YxWechatTemplate> page = yxWechatTemplateRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(yxWechatTemplateMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<YxWechatTemplateDTO> queryAll(YxWechatTemplateQueryCriteria criteria){
|
||||
return yxWechatTemplateMapper.toDto(yxWechatTemplateRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public YxWechatTemplateDTO findById(Integer id) {
|
||||
Optional<YxWechatTemplate> yxWechatTemplate = yxWechatTemplateRepository.findById(id);
|
||||
ValidationUtil.isNull(yxWechatTemplate,"YxWechatTemplate","id",id);
|
||||
return yxWechatTemplateMapper.toDto(yxWechatTemplate.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public YxWechatTemplateDTO create(YxWechatTemplate resources) {
|
||||
return yxWechatTemplateMapper.toDto(yxWechatTemplateRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(YxWechatTemplate resources) {
|
||||
Optional<YxWechatTemplate> optionalYxWechatTemplate = yxWechatTemplateRepository.findById(resources.getId());
|
||||
ValidationUtil.isNull( optionalYxWechatTemplate,"YxWechatTemplate","id",resources.getId());
|
||||
YxWechatTemplate yxWechatTemplate = optionalYxWechatTemplate.get();
|
||||
yxWechatTemplate.copy(resources);
|
||||
yxWechatTemplateRepository.save(yxWechatTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Integer id) {
|
||||
yxWechatTemplateRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.mp.domain.YxArticle;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface ArticleMapper extends CoreMapper<YxArticle> {
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.mp.domain.YxWechatMenu;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface WechatMenuMapper extends CoreMapper<YxWechatMenu> {
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.mp.domain.YxWechatReply;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface WechatReplyMapper extends CoreMapper<YxWechatReply> {
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.mp.domain.YxWechatTemplate;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface WechatTemplateMapper extends CoreMapper<YxWechatTemplate> {
|
||||
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package co.yixiang.mp.service.mapper;
|
||||
|
||||
import co.yixiang.mapper.EntityMapper;
|
||||
|
||||
import co.yixiang.mp.domain.YxArticle;
|
||||
import co.yixiang.mp.service.dto.YxArticleDTO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-07
|
||||
*/
|
||||
@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface YxArticleMapper extends EntityMapper<YxArticleDTO, YxArticle> {
|
||||
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
package co.yixiang.mp.service.mapper;
|
||||
|
||||
import co.yixiang.mapper.EntityMapper;
|
||||
import co.yixiang.mp.domain.YxWechatMenu;
|
||||
import co.yixiang.mp.service.dto.YxWechatMenuDTO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface YxWechatMenuMapper extends EntityMapper<YxWechatMenuDTO, YxWechatMenu> {
|
||||
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
package co.yixiang.mp.service.mapper;
|
||||
|
||||
import co.yixiang.mapper.EntityMapper;
|
||||
import co.yixiang.mp.domain.YxWechatReply;
|
||||
import co.yixiang.mp.service.dto.YxWechatReplyDTO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-10-10
|
||||
*/
|
||||
@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface YxWechatReplyMapper extends EntityMapper<YxWechatReplyDTO, YxWechatReply> {
|
||||
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
package co.yixiang.mp.service.mapper;
|
||||
|
||||
import co.yixiang.mapper.EntityMapper;
|
||||
import co.yixiang.mp.domain.YxWechatTemplate;
|
||||
import co.yixiang.mp.service.dto.YxWechatTemplateDTO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @author xuwenbo
|
||||
* @date 2019-12-10
|
||||
*/
|
||||
@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface YxWechatTemplateMapper extends EntityMapper<YxWechatTemplateDTO, YxWechatTemplate> {
|
||||
|
||||
}
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.utils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.mp.utils;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
Reference in New Issue
Block a user