--微信支付

This commit is contained in:
yc13649764453
2023-05-24 18:13:36 +08:00
parent 4e7aec5b60
commit 068192327c
25 changed files with 3241 additions and 657 deletions

View File

@@ -0,0 +1,69 @@
/**
* Copyright (c) 2016-2019 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有,侵权必究!
*/
package com.peanut.modules.sys.controller;
import com.peanut.common.utils.PageUtils;
import com.peanut.common.utils.R;
import com.peanut.modules.sys.entity.SysAgreementEntity;
import com.peanut.modules.sys.service.SysAgreementService;
import com.peanut.modules.sys.service.SysLogService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* 系统日志
*
* @author Mark sunlightcs@gmail.com
*/
@RestController
@RequestMapping("/sys/agreement")
public class SysAgreementController {
@Autowired
private SysAgreementService sysAgreementService;
/**
* 列表
*/
@ResponseBody
@GetMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = sysAgreementService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 保存
* @param agre
* @return
*/
@PostMapping("/save")
public R save(@RequestBody SysAgreementEntity agre){
sysAgreementService.save(agre);
return R.ok();
}
/**
* 更新
* @param agre
* @return
*/
@PostMapping("/update")
public R update(@RequestBody SysAgreementEntity agre){
sysAgreementService.updateById(agre);
return R.ok();
}
}

View File

@@ -0,0 +1,25 @@
/**
* Copyright (c) 2016-2019 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有,侵权必究!
*/
package com.peanut.modules.sys.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.peanut.modules.sys.entity.SysAgreementEntity;
import com.peanut.modules.sys.entity.SysLogEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 协议
*
* @author Mark sunlightcs@gmail.com
*/
@Mapper
public interface SysAgreementDao extends BaseMapper<SysAgreementEntity> {
}

View File

@@ -0,0 +1,30 @@
package com.peanut.modules.sys.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName("sys_agreement")
public class SysAgreementEntity {
@TableId
private Integer id;
/**
* 标题
*/
private String title;
/**
* 内容
*/
private String content;
/**
* 类型
* 会员member
* 充值: pay
*/
private String type;
}

View File

@@ -0,0 +1,29 @@
/**
* Copyright (c) 2016-2019 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有,侵权必究!
*/
package com.peanut.modules.sys.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.peanut.common.utils.PageUtils;
import com.peanut.modules.sys.entity.SysAgreementEntity;
import com.peanut.modules.sys.entity.SysLogEntity;
import java.util.Map;
/**
* 协议
*
* @author Mark sunlightcs@gmail.com
*/
public interface SysAgreementService extends IService<SysAgreementEntity> {
PageUtils queryPage(Map<String, Object> params);
}

View File

@@ -0,0 +1,42 @@
/**
* Copyright (c) 2016-2019 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有,侵权必究!
*/
package com.peanut.modules.sys.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.common.utils.PageUtils;
import com.peanut.common.utils.Query;
import com.peanut.modules.sys.dao.SysAgreementDao;
import com.peanut.modules.sys.dao.SysLogDao;
import com.peanut.modules.sys.entity.SysAgreementEntity;
import com.peanut.modules.sys.entity.SysLogEntity;
import com.peanut.modules.sys.service.SysAgreementService;
import com.peanut.modules.sys.service.SysLogService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
@Service("sysAgreementService")
public class SysAgreementServiceImpl extends ServiceImpl<SysAgreementDao, SysAgreementEntity> implements SysAgreementService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
String key = (String)params.get("key");
IPage<SysAgreementEntity> page = this.page(
new Query<SysAgreementEntity>().getPage(params),
new QueryWrapper<SysAgreementEntity>().like(StringUtils.isNotBlank(key),"type", key)
);
return new PageUtils(page);
}
}