Commit 1fc880d9 by giaogiao

用户相关接口, 登陆接口

parent 69543e53
......@@ -22,7 +22,6 @@ import org.springframework.web.bind.annotation.RestController;
*/
@Slf4j
@RestController
//@Module("api-app")
@Api(value = "短信验证码", tags = {"APP短信验证码相关"})
@RequestMapping("/sms")
public class AppSmsController extends BaseController {
......
......@@ -4,6 +4,8 @@ import com.sien.common.param.app.AppSmsRegisterParam;
import com.sien.common.param.app.AppUserInfoParam;
import com.sien.common.param.app.AppUserPhoneUpdateParam;
import com.sien.common.service.AppUserApiService;
import com.sien.common.service.AppUserService;
import com.sien.common.vo.AppUserQueryVo;
import com.sien.common.vo.app.LoginAppUserTokenVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
......@@ -15,6 +17,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
......@@ -34,12 +37,25 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/user")
public class AppUserController extends BaseController {
// @Autowired
// private AppUserService appUserService;
@Autowired
private AppUserService appUserService;
@Autowired
private AppUserApiService appUserApiService;
/**
* 获取自己的信息详情
*/
@GetMapping("/myInfo/")
@OperationLog(name = "APP用户详情", type = OperationLogType.INFO)
@ApiOperation(value = "APP用户详情", response = AppUserQueryVo.class)
public ApiResult<AppUserQueryVo> getAppUser() throws Exception {
AppUserQueryVo appUserQueryVo = appUserService.getMyInfo();
return ApiResult.ok(appUserQueryVo);
}
@PostMapping("/registerOrLogin")
@ApiOperation(value = "手机号注册+登陆", notes = "app用户注册+登陆", response = LoginAppUserTokenVo.class)
public ApiResult<LoginAppUserTokenVo> registerOrLogin(@Validated @RequestBody AppSmsRegisterParam appSmsRegisterParam, @RequestHeader(required = false) String language) throws Exception {
......@@ -140,9 +156,11 @@ public class AppUserController extends BaseController {
return ApiResult.result(flag);
}
*//**
*/
/**
* 获取APP用户详情
*//*
*/
/*
@GetMapping("/info/{id}")
@OperationLog(name = "APP用户详情", type = OperationLogType.INFO)
@ApiOperation(value = "APP用户详情", response = AppUserQueryVo.class)
......
package com.sien.common.controller;
import com.sien.common.entity.DonationAgent;
import com.sien.common.param.DonationAgentPageParam;
import com.sien.common.service.DonationAgentService;
import com.sien.common.vo.DonationAgentQueryVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.core.validator.groups.Add;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -37,61 +22,61 @@ public class DonationAgentController extends BaseController {
@Autowired
private DonationAgentService donationAgentService;
/**
* 添加替他人捐款记录表
*/
@PostMapping("/add")
@OperationLog(name = "添加替他人捐款记录表", type = OperationLogType.ADD)
@ApiOperation(value = "添加替他人捐款记录表")
public ApiResult<Boolean> addDonationAgent(@Validated(Add.class) @RequestBody DonationAgent donationAgent) throws Exception {
boolean flag = donationAgentService.saveDonationAgent(donationAgent);
return ApiResult.result(flag);
}
/**
* 修改替他人捐款记录表
*/
@PostMapping("/update")
@OperationLog(name = "修改替他人捐款记录表", type = OperationLogType.UPDATE)
@ApiOperation(value = "修改替他人捐款记录表")
public ApiResult<Boolean> updateDonationAgent(@Validated(Update.class) @RequestBody DonationAgent donationAgent)throws Exception{
boolean flag= donationAgentService.updateDonationAgent(donationAgent);
return ApiResult.result(flag);
}
/**
* 删除替他人捐款记录表
*/
@PostMapping("/delete/{id}")
@OperationLog(name = "删除替他人捐款记录表", type = OperationLogType.DELETE)
@ApiOperation(value = "删除替他人捐款记录表")
public ApiResult<Boolean> deleteDonationAgent(@PathVariable("id") Long id)throws Exception{
boolean flag= donationAgentService.deleteDonationAgent(id);
return ApiResult.result(flag);
}
/**
* 获取替他人捐款记录表详情
*/
@GetMapping("/info/{id}")
@OperationLog(name = "替他人捐款记录表详情", type = OperationLogType.INFO)
@ApiOperation(value = "替他人捐款记录表详情")
public ApiResult<DonationAgentQueryVo> getDonationAgent(@PathVariable("id") Long id)throws Exception{
DonationAgentQueryVo donationAgentQueryVo = donationAgentService.getDonationAgentById(id);
return ApiResult.ok(donationAgentQueryVo);
}
/**
* 替他人捐款记录表分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "替他人捐款记录表分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "替他人捐款记录表分页列表")
public ApiResult<Paging<DonationAgentQueryVo>>getDonationAgentPageList(@Validated @RequestBody DonationAgentPageParam donationAgentPageParam)throws Exception{
Paging<DonationAgentQueryVo> paging = donationAgentService.getDonationAgentPageList(donationAgentPageParam);
return ApiResult.ok(paging);
}
//
// /**
// * 添加替他人捐款记录表
// */
// @PostMapping("/add")
// @OperationLog(name = "添加替他人捐款记录表", type = OperationLogType.ADD)
// @ApiOperation(value = "添加替他人捐款记录表")
// public ApiResult<Boolean> addDonationAgent(@Validated(Add.class) @RequestBody DonationAgent donationAgent) throws Exception {
// boolean flag = donationAgentService.saveDonationAgent(donationAgent);
// return ApiResult.result(flag);
// }
//
// /**
// * 修改替他人捐款记录表
// */
// @PostMapping("/update")
// @OperationLog(name = "修改替他人捐款记录表", type = OperationLogType.UPDATE)
// @ApiOperation(value = "修改替他人捐款记录表")
// public ApiResult<Boolean> updateDonationAgent(@Validated(Update.class) @RequestBody DonationAgent donationAgent)throws Exception{
// boolean flag= donationAgentService.updateDonationAgent(donationAgent);
// return ApiResult.result(flag);
// }
//
// /**
// * 删除替他人捐款记录表
// */
// @PostMapping("/delete/{id}")
// @OperationLog(name = "删除替他人捐款记录表", type = OperationLogType.DELETE)
// @ApiOperation(value = "删除替他人捐款记录表")
// public ApiResult<Boolean> deleteDonationAgent(@PathVariable("id") Long id)throws Exception{
// boolean flag= donationAgentService.deleteDonationAgent(id);
// return ApiResult.result(flag);
// }
//
// /**
// * 获取替他人捐款记录表详情
// */
// @GetMapping("/info/{id}")
// @OperationLog(name = "替他人捐款记录表详情", type = OperationLogType.INFO)
// @ApiOperation(value = "替他人捐款记录表详情")
// public ApiResult<DonationAgentQueryVo> getDonationAgent(@PathVariable("id") Long id)throws Exception{
// DonationAgentQueryVo donationAgentQueryVo = donationAgentService.getDonationAgentById(id);
// return ApiResult.ok(donationAgentQueryVo);
// }
//
// /**
// * 替他人捐款记录表分页列表
// */
// @PostMapping("/getPageList")
// @OperationLog(name = "替他人捐款记录表分页列表", type = OperationLogType.PAGE)
// @ApiOperation(value = "替他人捐款记录表分页列表")
// public ApiResult<Paging<DonationAgentQueryVo>>getDonationAgentPageList(@Validated @RequestBody DonationAgentPageParam donationAgentPageParam)throws Exception{
// Paging<DonationAgentQueryVo> paging = donationAgentService.getDonationAgentPageList(donationAgentPageParam);
// return ApiResult.ok(paging);
// }
}
package com.sien.common.controller;
import com.sien.common.entity.DonationRecord;
import com.sien.common.param.DonationRecordPageParam;
import com.sien.common.service.DonationRecordService;
import com.sien.common.vo.DonationRecordQueryVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.core.validator.groups.Add;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -38,60 +23,60 @@ public class DonationRecordController extends BaseController {
@Autowired
private DonationRecordService donationRecordService;
/**
* 添加捐款记录
*/
@PostMapping("/add")
@OperationLog(name = "添加捐款记录", type = OperationLogType.ADD)
@ApiOperation(value = "添加捐款记录")
public ApiResult<Boolean> addDonationRecord(@Validated(Add.class) @RequestBody DonationRecord donationRecord)throws Exception{
boolean flag= donationRecordService.saveDonationRecord(donationRecord);
return ApiResult.result(flag);
}
// /**
// * 添加捐款记录
// */
// @PostMapping("/add")
// @OperationLog(name = "添加捐款记录", type = OperationLogType.ADD)
// @ApiOperation(value = "添加捐款记录")
// public ApiResult<Boolean> addDonationRecord(@Validated(Add.class) @RequestBody DonationRecord donationRecord)throws Exception{
// boolean flag= donationRecordService.saveDonationRecord(donationRecord);
// return ApiResult.result(flag);
// }
/**
* 修改捐款记录
*/
@PostMapping("/update")
@OperationLog(name = "修改捐款记录", type = OperationLogType.UPDATE)
@ApiOperation(value = "修改捐款记录")
public ApiResult<Boolean> updateDonationRecord(@Validated(Update.class) @RequestBody DonationRecord donationRecord)throws Exception{
boolean flag= donationRecordService.updateDonationRecord(donationRecord);
return ApiResult.result(flag);
}
// /**
// * 修改捐款记录
// */
// @PostMapping("/update")
// @OperationLog(name = "修改捐款记录", type = OperationLogType.UPDATE)
// @ApiOperation(value = "修改捐款记录")
// public ApiResult<Boolean> updateDonationRecord(@Validated(Update.class) @RequestBody DonationRecord donationRecord)throws Exception{
// boolean flag= donationRecordService.updateDonationRecord(donationRecord);
// return ApiResult.result(flag);
// }
//
// /**
// * 删除捐款记录
// */
// @PostMapping("/delete/{id}")
// @OperationLog(name = "删除捐款记录", type = OperationLogType.DELETE)
// @ApiOperation(value = "删除捐款记录")
// public ApiResult<Boolean> deleteDonationRecord(@PathVariable("id") Long id)throws Exception{
// boolean flag= donationRecordService.deleteDonationRecord(id);
// return ApiResult.result(flag);
// }
//
// /**
// * 获取捐款记录详情
// */
// @GetMapping("/info/{id}")
// @OperationLog(name = "捐款记录详情", type = OperationLogType.INFO)
// @ApiOperation(value = "捐款记录详情")
// public ApiResult<DonationRecordQueryVo> getDonationRecord(@PathVariable("id") Long id)throws Exception{
// DonationRecordQueryVo donationRecordQueryVo = donationRecordService.getDonationRecordById(id);
// return ApiResult.ok(donationRecordQueryVo);
// }
//
// /**
// * 捐款记录分页列表
// */
// @PostMapping("/getPageList")
// @OperationLog(name = "捐款记录分页列表", type = OperationLogType.PAGE)
// @ApiOperation(value = "捐款记录分页列表")
// public ApiResult<Paging<DonationRecordQueryVo>>getDonationRecordPageList(@Validated @RequestBody DonationRecordPageParam donationRecordPageParam)throws Exception{
// Paging<DonationRecordQueryVo> paging = donationRecordService.getDonationRecordPageList(donationRecordPageParam);
// return ApiResult.ok(paging);
// }
/**
* 删除捐款记录
*/
@PostMapping("/delete/{id}")
@OperationLog(name = "删除捐款记录", type = OperationLogType.DELETE)
@ApiOperation(value = "删除捐款记录")
public ApiResult<Boolean> deleteDonationRecord(@PathVariable("id") Long id)throws Exception{
boolean flag= donationRecordService.deleteDonationRecord(id);
return ApiResult.result(flag);
}
/**
* 获取捐款记录详情
*/
@GetMapping("/info/{id}")
@OperationLog(name = "捐款记录详情", type = OperationLogType.INFO)
@ApiOperation(value = "捐款记录详情")
public ApiResult<DonationRecordQueryVo> getDonationRecord(@PathVariable("id") Long id)throws Exception{
DonationRecordQueryVo donationRecordQueryVo = donationRecordService.getDonationRecordById(id);
return ApiResult.ok(donationRecordQueryVo);
}
/**
* 捐款记录分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "捐款记录分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "捐款记录分页列表")
public ApiResult<Paging<DonationRecordQueryVo>>getDonationRecordPageList(@Validated @RequestBody DonationRecordPageParam donationRecordPageParam)throws Exception{
Paging<DonationRecordQueryVo> paging = donationRecordService.getDonationRecordPageList(donationRecordPageParam);
return ApiResult.ok(paging);
}
}
}
package com.sien.common.controller;
import com.sien.common.entity.VipRecord;
import com.sien.common.param.VipRecordPageParam;
import com.sien.common.vo.VipRecordQueryVo;
import com.sien.common.service.VipRecordService;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.core.validator.groups.Add;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -38,60 +23,60 @@ public class VipRecordController extends BaseController {
@Autowired
private VipRecordService vipRecordService;
/**
* 添加Vip开通记录
*/
@PostMapping("/add")
@OperationLog(name = "添加Vip开通记录", type = OperationLogType.ADD)
@ApiOperation(value = "添加Vip开通记录")
public ApiResult<Boolean> addVipRecord(@Validated(Add.class) @RequestBody VipRecord vipRecord)throws Exception{
boolean flag= vipRecordService.saveVipRecord(vipRecord);
return ApiResult.result(flag);
}
// /**
// * 添加Vip开通记录
// */
// @PostMapping("/add")
// @OperationLog(name = "添加Vip开通记录", type = OperationLogType.ADD)
// @ApiOperation(value = "添加Vip开通记录")
// public ApiResult<Boolean> addVipRecord(@Validated(Add.class) @RequestBody VipRecord vipRecord)throws Exception{
// boolean flag= vipRecordService.saveVipRecord(vipRecord);
// return ApiResult.result(flag);
// }
//
// /**
// * 修改Vip开通记录
// */
// @PostMapping("/update")
// @OperationLog(name = "修改Vip开通记录", type = OperationLogType.UPDATE)
// @ApiOperation(value = "修改Vip开通记录")
// public ApiResult<Boolean> updateVipRecord(@Validated(Update.class) @RequestBody VipRecord vipRecord)throws Exception{
// boolean flag= vipRecordService.updateVipRecord(vipRecord);
// return ApiResult.result(flag);
// }
//
// /**
// * 删除Vip开通记录
// */
// @PostMapping("/delete/{id}")
// @OperationLog(name = "删除Vip开通记录", type = OperationLogType.DELETE)
// @ApiOperation(value = "删除Vip开通记录")
// public ApiResult<Boolean> deleteVipRecord(@PathVariable("id") Long id)throws Exception{
// boolean flag= vipRecordService.deleteVipRecord(id);
// return ApiResult.result(flag);
// }
//
// /**
// * 获取Vip开通记录详情
// */
// @GetMapping("/info/{id}")
// @OperationLog(name = "Vip开通记录详情", type = OperationLogType.INFO)
// @ApiOperation(value = "Vip开通记录详情")
// public ApiResult<VipRecordQueryVo> getVipRecord(@PathVariable("id") Long id)throws Exception{
// VipRecordQueryVo vipRecordQueryVo = vipRecordService.getVipRecordById(id);
// return ApiResult.ok(vipRecordQueryVo);
// }
//
// /**
// * Vip开通记录分页列表
// */
// @PostMapping("/getPageList")
// @OperationLog(name = "Vip开通记录分页列表", type = OperationLogType.PAGE)
// @ApiOperation(value = "Vip开通记录分页列表")
// public ApiResult<Paging<VipRecordQueryVo>>getVipRecordPageList(@Validated @RequestBody VipRecordPageParam vipRecordPageParam)throws Exception{
// Paging<VipRecordQueryVo> paging = vipRecordService.getVipRecordPageList(vipRecordPageParam);
// return ApiResult.ok(paging);
// }
/**
* 修改Vip开通记录
*/
@PostMapping("/update")
@OperationLog(name = "修改Vip开通记录", type = OperationLogType.UPDATE)
@ApiOperation(value = "修改Vip开通记录")
public ApiResult<Boolean> updateVipRecord(@Validated(Update.class) @RequestBody VipRecord vipRecord)throws Exception{
boolean flag= vipRecordService.updateVipRecord(vipRecord);
return ApiResult.result(flag);
}
/**
* 删除Vip开通记录
*/
@PostMapping("/delete/{id}")
@OperationLog(name = "删除Vip开通记录", type = OperationLogType.DELETE)
@ApiOperation(value = "删除Vip开通记录")
public ApiResult<Boolean> deleteVipRecord(@PathVariable("id") Long id)throws Exception{
boolean flag= vipRecordService.deleteVipRecord(id);
return ApiResult.result(flag);
}
/**
* 获取Vip开通记录详情
*/
@GetMapping("/info/{id}")
@OperationLog(name = "Vip开通记录详情", type = OperationLogType.INFO)
@ApiOperation(value = "Vip开通记录详情")
public ApiResult<VipRecordQueryVo> getVipRecord(@PathVariable("id") Long id)throws Exception{
VipRecordQueryVo vipRecordQueryVo = vipRecordService.getVipRecordById(id);
return ApiResult.ok(vipRecordQueryVo);
}
/**
* Vip开通记录分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "Vip开通记录分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "Vip开通记录分页列表")
public ApiResult<Paging<VipRecordQueryVo>>getVipRecordPageList(@Validated @RequestBody VipRecordPageParam vipRecordPageParam)throws Exception{
Paging<VipRecordQueryVo> paging = vipRecordService.getVipRecordPageList(vipRecordPageParam);
return ApiResult.ok(paging);
}
}
}
package com.sien.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sien.common.entity.DonationRecord;
import com.sien.common.param.DonationRecordPageParam;
import com.sien.common.vo.DonationRankAndTotal;
import com.sien.common.vo.DonationRecordQueryVo;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.io.Serializable;
......@@ -22,21 +21,29 @@ import java.io.Serializable;
@Repository
public interface DonationRecordMapper extends BaseMapper<DonationRecord> {
/**
* 根据ID获取查询对象
*
* @param id
* @return
*/
DonationRecordQueryVo getDonationRecordById(Serializable id);
/**
* 获取分页对象
*
* @param page
* @param donationRecordPageParam
* @return
*/
IPage<DonationRecordQueryVo> getDonationRecordPageList(@Param("page") Page page,@Param("param") DonationRecordPageParam donationRecordPageParam);
}
/**
* 根据ID获取查询对象
*
* @param id
* @return
*/
DonationRecordQueryVo getDonationRecordById(Serializable id);
/**
* 获取分页对象
*
* @param page
* @param donationRecordPageParam
* @return
*/
IPage<DonationRecordQueryVo> getDonationRecordPageList(@Param("page") Page page, @Param("param") DonationRecordPageParam donationRecordPageParam);
/**
* 查询捐款排名
*
* @param userId
* @return
*/
DonationRankAndTotal getDonationRankAndTotal(@Param("userId") Long userId);
}
......@@ -46,4 +46,7 @@ public class AppSmsRegisterParam implements Serializable {
@ApiModelProperty(value = "微信id", example = "adfadlsfadsf", required = false)
private String openid;
@ApiModelProperty("姓名")
private String nickname;
}
......@@ -19,18 +19,39 @@ import lombok.experimental.Accessors;
@ApiModel(value = "AppUserInfoParam对象")
public class AppUserInfoParam extends BaseEntity {
@ApiModelProperty("用户名")
private String username;
@ApiModelProperty("微信id")
private String wechatOpenId;
@ApiModelProperty("姓名")
private String nickname;
@ApiModelProperty("性别,0:女,1:男,默认1")
private Integer gender;
@ApiModelProperty("证件号码")
private String idcard;
@ApiModelProperty("民族")
private String nation;
@ApiModelProperty("手机号码")
private String phone;
@ApiModelProperty("手机区号")
private String phoneArea;
@ApiModelProperty("性别,0:女,1:男,默认1")
private Integer gender;
@ApiModelProperty("头像")
private String head;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("状态,0:禁用,1:启用,2:锁定")
private Integer state;
@ApiModelProperty("出生日期")
private String dateOfBirth;
......@@ -55,7 +76,4 @@ public class AppUserInfoParam extends BaseEntity {
@ApiModelProperty("紧急电话")
private String emergencyPhone;
@ApiModelProperty("头像")
private String head;
}
......@@ -39,23 +39,23 @@ public class Demo {
// App Master Secret
// ti5gomxtvmkgehmwgtbq9rtsfhy0khsi
// TODO set your appkey and master secret here
// set your appkey and master secret here
// Demo demo = new Demo("your appkey", "your master secret");
Demo demo = new Demo("5f963f3ea1491772a2aef713", "ti5gomxtvmkgehmwgtbq9rtsfhy0khsi");
try {
demo.sendAndroidUnicast("As3YYnUpKwDLFVzc35_syVTNSctGjkDNfFLwPHGbXtm_");
//demo.sendIOSUnicast();
/* TODO these methods are all available, just fill in some fields and do the test
* demo.sendAndroidCustomizedcastFile();
* demo.sendAndroidBroadcast();
* demo.sendAndroidGroupcast();
* demo.sendAndroidCustomizedcast();
* demo.sendAndroidFilecast();
*
* demo.sendIOSBroadcast();
* demo.sendIOSUnicast();
* demo.sendIOSGroupcast();
* demo.sendIOSCustomizedcast();
Demo demo = new Demo("5f963f3ea1491772a2aef713", "ti5gomxtvmkgehmwgtbq9rtsfhy0khsi");
try {
demo.sendAndroidUnicast("As3YYnUpKwDLFVzc35_syVTNSctGjkDNfFLwPHGbXtm_");
//demo.sendIOSUnicast();
/* these methods are all available, just fill in some fields and do the test
* demo.sendAndroidCustomizedcastFile();
* demo.sendAndroidBroadcast();
* demo.sendAndroidGroupcast();
* demo.sendAndroidCustomizedcast();
* demo.sendAndroidFilecast();
*
* demo.sendIOSBroadcast();
* demo.sendIOSUnicast();
* demo.sendIOSGroupcast();
* demo.sendIOSCustomizedcast();
* demo.sendIOSFilecast();
*/
} catch (Exception ex) {
......@@ -64,22 +64,22 @@ public class Demo {
}
public void sendAndroidBroadcast() throws Exception {
AndroidBroadcast broadcast = new AndroidBroadcast(appkey, appMasterSecret);
broadcast.setTicker("Android broadcast ticker");
broadcast.setTitle("中文的title");
broadcast.setText("Android broadcast text");
broadcast.goAppAfterOpen();
broadcast.setDisplayType(AndroidNotification.DisplayType.NOTIFICATION);
// TODO Set 'production_mode' to 'false' if it's a test device.
// For how to register a test device, please see the developer doc.
broadcast.setProductionMode();
// Set customized fields
broadcast.setExtraField("test", "helloworld");
//厂商通道相关参数
broadcast.setChannelActivity("your channel activity");
broadcast.setChannelProperties("abc");
client.send(broadcast);
}
AndroidBroadcast broadcast = new AndroidBroadcast(appkey, appMasterSecret);
broadcast.setTicker("Android broadcast ticker");
broadcast.setTitle("中文的title");
broadcast.setText("Android broadcast text");
broadcast.goAppAfterOpen();
broadcast.setDisplayType(AndroidNotification.DisplayType.NOTIFICATION);
// Set 'production_mode' to 'false' if it's a test device.
// For how to register a test device, please see the developer doc.
broadcast.setProductionMode();
// Set customized fields
broadcast.setExtraField("test", "helloworld");
//厂商通道相关参数
broadcast.setChannelActivity("your channel activity");
broadcast.setChannelProperties("abc");
client.send(broadcast);
}
/**
* 发送安卓单推
......@@ -87,37 +87,37 @@ public class Demo {
* @throws Exception
*/
public void sendAndroidUnicast(String token) throws Exception {
AndroidUnicast unicast = new AndroidUnicast(appkey, appMasterSecret);
// TODO Set your device token
unicast.setDeviceToken(token);
unicast.setTicker("Android unicast ticker");
unicast.setTitle("api 中文的title");
unicast.setText("Android unicast text");
unicast.goAppAfterOpen();
unicast.setDisplayType(AndroidNotification.DisplayType.NOTIFICATION);
// TODO Set 'production_mode' to 'false' if it's a test device.
// For how to register a test device, please see the developer doc.
unicast.setProductionMode();
// Set customized fields
unicast.setExtraField("test", "helloworld");
unicast.setChannelActivity("your channel activity");
unicast.setChannelProperties("abc");
client.send(unicast);
}
AndroidUnicast unicast = new AndroidUnicast(appkey, appMasterSecret);
// Set your device token
unicast.setDeviceToken(token);
unicast.setTicker("Android unicast ticker");
unicast.setTitle("api 中文的title");
unicast.setText("Android unicast text");
unicast.goAppAfterOpen();
unicast.setDisplayType(AndroidNotification.DisplayType.NOTIFICATION);
// Set 'production_mode' to 'false' if it's a test device.
// For how to register a test device, please see the developer doc.
unicast.setProductionMode();
// Set customized fields
unicast.setExtraField("test", "helloworld");
unicast.setChannelActivity("your channel activity");
unicast.setChannelProperties("abc");
client.send(unicast);
}
public void sendAndroidGroupcast() throws Exception {
AndroidGroupcast groupcast = new AndroidGroupcast(appkey, appMasterSecret);
/* TODO
* Construct the filter condition:
* "where":
* {
* "and":
* [
* {"tag":"test"},
* {"tag":"Test"}
* ]
* }
*/
AndroidGroupcast groupcast = new AndroidGroupcast(appkey, appMasterSecret);
/*
* Construct the filter condition:
* "where":
* {
* "and":
* [
* {"tag":"test"},
* {"tag":"Test"}
* ]
* }
*/
JSONObject filterJson = new JSONObject();
JSONObject whereJson = new JSONObject();
JSONArray tagArray = new JSONArray();
......@@ -127,178 +127,178 @@ public class Demo {
TestTag.put("tag", "Test");
tagArray.put(testTag);
tagArray.put(TestTag);
whereJson.put("and", tagArray);
filterJson.put("where", whereJson);
whereJson.put("and", tagArray);
filterJson.put("where", whereJson);
groupcast.setFilter(filterJson);
groupcast.setTicker("Android groupcast ticker");
groupcast.setTitle("中文的title");
groupcast.setText("Android groupcast text");
groupcast.goAppAfterOpen();
groupcast.setDisplayType(AndroidNotification.DisplayType.NOTIFICATION);
groupcast.setChannelActivity("your channel activity");
// TODO Set 'production_mode' to 'false' if it's a test device.
// For how to register a test device, please see the developer doc.
groupcast.setProductionMode();
//厂商通道相关参数
groupcast.setChannelActivity("your channel activity");
groupcast.setChannelProperties("abc");
client.send(groupcast);
}
groupcast.setFilter(filterJson);
groupcast.setTicker("Android groupcast ticker");
groupcast.setTitle("中文的title");
groupcast.setText("Android groupcast text");
groupcast.goAppAfterOpen();
groupcast.setDisplayType(AndroidNotification.DisplayType.NOTIFICATION);
groupcast.setChannelActivity("your channel activity");
// Set 'production_mode' to 'false' if it's a test device.
// For how to register a test device, please see the developer doc.
groupcast.setProductionMode();
//厂商通道相关参数
groupcast.setChannelActivity("your channel activity");
groupcast.setChannelProperties("abc");
client.send(groupcast);
}
public void sendAndroidCustomizedcast() throws Exception {
AndroidCustomizedcast customizedcast = new AndroidCustomizedcast(appkey, appMasterSecret);
// TODO Set your alias here, and use comma to split them if there are multiple alias.
// And if you have many alias, you can also upload a file containing these alias, then
// use file_id to send customized notification.
customizedcast.setAlias("alias", "alias_type");
customizedcast.setTicker("Android customizedcast ticker");
customizedcast.setTitle("中文的title");
customizedcast.setText("Android customizedcast text");
customizedcast.goAppAfterOpen();
customizedcast.setDisplayType(AndroidNotification.DisplayType.NOTIFICATION);
// TODO Set 'production_mode' to 'false' if it's a test device.
// For how to register a test device, please see the developer doc.
customizedcast.setProductionMode();
//厂商通道相关参数
customizedcast.setChannelActivity("your channel activity");
customizedcast.setChannelProperties("abc");
client.send(customizedcast);
}
AndroidCustomizedcast customizedcast = new AndroidCustomizedcast(appkey, appMasterSecret);
// Set your alias here, and use comma to split them if there are multiple alias.
// And if you have many alias, you can also upload a file containing these alias, then
// use file_id to send customized notification.
customizedcast.setAlias("alias", "alias_type");
customizedcast.setTicker("Android customizedcast ticker");
customizedcast.setTitle("中文的title");
customizedcast.setText("Android customizedcast text");
customizedcast.goAppAfterOpen();
customizedcast.setDisplayType(AndroidNotification.DisplayType.NOTIFICATION);
// Set 'production_mode' to 'false' if it's a test device.
// For how to register a test device, please see the developer doc.
customizedcast.setProductionMode();
//厂商通道相关参数
customizedcast.setChannelActivity("your channel activity");
customizedcast.setChannelProperties("abc");
client.send(customizedcast);
}
public void sendAndroidCustomizedcastFile() throws Exception {
AndroidCustomizedcast customizedcast = new AndroidCustomizedcast(appkey, appMasterSecret);
// TODO Set your alias here, and use comma to split them if there are multiple alias.
// And if you have many alias, you can also upload a file containing these alias, then
// use file_id to send customized notification.
String fileId = client.uploadContents(appkey, appMasterSecret, "aa" + "\n" + "bb" + "\n" + "alias");
customizedcast.setFileId(fileId, "alias_type");
customizedcast.setTicker("Android customizedcast ticker");
customizedcast.setTitle("中文的title");
customizedcast.setText("Android customizedcast text");
customizedcast.goAppAfterOpen();
customizedcast.setDisplayType(AndroidNotification.DisplayType.NOTIFICATION);
// TODO Set 'production_mode' to 'false' if it's a test device.
// For how to register a test device, please see the developer doc.
customizedcast.setProductionMode();
//厂商通道相关参数
customizedcast.setChannelActivity("your channel activity");
customizedcast.setChannelProperties("abc");
client.send(customizedcast);
}
AndroidCustomizedcast customizedcast = new AndroidCustomizedcast(appkey, appMasterSecret);
// Set your alias here, and use comma to split them if there are multiple alias.
// And if you have many alias, you can also upload a file containing these alias, then
// use file_id to send customized notification.
String fileId = client.uploadContents(appkey, appMasterSecret, "aa" + "\n" + "bb" + "\n" + "alias");
customizedcast.setFileId(fileId, "alias_type");
customizedcast.setTicker("Android customizedcast ticker");
customizedcast.setTitle("中文的title");
customizedcast.setText("Android customizedcast text");
customizedcast.goAppAfterOpen();
customizedcast.setDisplayType(AndroidNotification.DisplayType.NOTIFICATION);
// Set 'production_mode' to 'false' if it's a test device.
// For how to register a test device, please see the developer doc.
customizedcast.setProductionMode();
//厂商通道相关参数
customizedcast.setChannelActivity("your channel activity");
customizedcast.setChannelProperties("abc");
client.send(customizedcast);
}
public void sendAndroidFilecast() throws Exception {
AndroidFilecast filecast = new AndroidFilecast(appkey, appMasterSecret);
// TODO upload your device tokens, and use '\n' to split them if there are multiple tokens
String fileId = client.uploadContents(appkey, appMasterSecret, "aa" + "\n" + "bb");
filecast.setFileId(fileId);
filecast.setTicker("Android filecast ticker");
filecast.setTitle("中文的title");
filecast.setText("Android filecast text");
filecast.goAppAfterOpen();
filecast.setDisplayType(AndroidNotification.DisplayType.NOTIFICATION);
//厂商通道相关参数
filecast.setChannelActivity("your channel activity");
filecast.setChannelProperties("abc");
AndroidFilecast filecast = new AndroidFilecast(appkey, appMasterSecret);
// upload your device tokens, and use '\n' to split them if there are multiple tokens
String fileId = client.uploadContents(appkey, appMasterSecret, "aa" + "\n" + "bb");
filecast.setFileId(fileId);
filecast.setTicker("Android filecast ticker");
filecast.setTitle("中文的title");
filecast.setText("Android filecast text");
filecast.goAppAfterOpen();
filecast.setDisplayType(AndroidNotification.DisplayType.NOTIFICATION);
//厂商通道相关参数
filecast.setChannelActivity("your channel activity");
filecast.setChannelProperties("abc");
client.send(filecast);
}
public void sendIOSBroadcast() throws Exception {
IOSBroadcast broadcast = new IOSBroadcast(appkey, appMasterSecret);
//alert值设置为字符串
//broadcast.setAlert("IOS 广播测试");
//alert的值设置为字典
broadcast.setAlert("今日天气", "", "今日可能下雨🌂");
broadcast.setBadge(0);
broadcast.setSound("default");
// TODO set 'production_mode' to 'true' if your app is under production mode
broadcast.setTestMode();
// Set customized fields
broadcast.setCustomizedField("test", "helloworld");
client.send(broadcast);
}
IOSBroadcast broadcast = new IOSBroadcast(appkey, appMasterSecret);
//alert值设置为字符串
//broadcast.setAlert("IOS 广播测试");
//alert的值设置为字典
broadcast.setAlert("今日天气", "", "今日可能下雨🌂");
broadcast.setBadge(0);
broadcast.setSound("default");
// set 'production_mode' to 'true' if your app is under production mode
broadcast.setTestMode();
// Set customized fields
broadcast.setCustomizedField("test", "helloworld");
client.send(broadcast);
}
public void sendIOSUnicast() throws Exception {
IOSUnicast unicast = new IOSUnicast(appkey, appMasterSecret);
// TODO Set your device token
unicast.setDeviceToken("your device_token");
//alert值设置为字符串
//unicast.setAlert("IOS 单播测试");
//alert的值设置为字典
unicast.setAlert("今日天气", "", "今日可能下雨🌂");
unicast.setBadge(0);
unicast.setSound("default");
// TODO set 'production_mode' to 'true' if your app is under production mode
unicast.setTestMode();
// Set customized fields
unicast.setCustomizedField("test", "helloworld");
client.send(unicast);
}
IOSUnicast unicast = new IOSUnicast(appkey, appMasterSecret);
// Set your device token
unicast.setDeviceToken("your device_token");
//alert值设置为字符串
//unicast.setAlert("IOS 单播测试");
//alert的值设置为字典
unicast.setAlert("今日天气", "", "今日可能下雨🌂");
unicast.setBadge(0);
unicast.setSound("default");
// set 'production_mode' to 'true' if your app is under production mode
unicast.setTestMode();
// Set customized fields
unicast.setCustomizedField("test", "helloworld");
client.send(unicast);
}
public void sendIOSGroupcast() throws Exception {
IOSGroupcast groupcast = new IOSGroupcast(appkey, appMasterSecret);
/* TODO
* Construct the filter condition:
* "where":
* {
* "and":
* [
* {"tag":"iostest"}
* ]
* }
*/
JSONObject filterJson = new JSONObject();
IOSGroupcast groupcast = new IOSGroupcast(appkey, appMasterSecret);
/*
* Construct the filter condition:
* "where":
* {
* "and":
* [
* {"tag":"iostest"}
* ]
* }
*/
JSONObject filterJson = new JSONObject();
JSONObject whereJson = new JSONObject();
JSONArray tagArray = new JSONArray();
JSONObject testTag = new JSONObject();
testTag.put("tag", "iostest");
tagArray.put(testTag);
whereJson.put("and", tagArray);
filterJson.put("where", whereJson);
System.out.println(filterJson.toString());
filterJson.put("where", whereJson);
System.out.println(filterJson.toString());
// Set filter condition into rootJson
groupcast.setFilter(filterJson);
//groupcast.setAlert("IOS 组播测试");
//alert的值设置为字典
groupcast.setAlert("今日天气", "subtitle", "今日可能下雨🌂");
groupcast.setBadge(0);
groupcast.setSound("default");
// TODO set 'production_mode' to 'true' if your app is under production mode
groupcast.setTestMode();
client.send(groupcast);
}
// Set filter condition into rootJson
groupcast.setFilter(filterJson);
//groupcast.setAlert("IOS 组播测试");
//alert的值设置为字典
groupcast.setAlert("今日天气", "subtitle", "今日可能下雨🌂");
groupcast.setBadge(0);
groupcast.setSound("default");
// set 'production_mode' to 'true' if your app is under production mode
groupcast.setTestMode();
client.send(groupcast);
}
public void sendIOSCustomizedcast() throws Exception {
IOSCustomizedcast customizedcast = new IOSCustomizedcast(appkey, appMasterSecret);
// TODO Set your alias and alias_type here, and use comma to split them if there are multiple alias.
// And if you have many alias, you can also upload a file containing these alias, then
// use file_id to send customized notification.
customizedcast.setAlias("alias", "alias_type");
//customizedcast.setAlert("IOS 个性化测试");
//alert的值设置为字典
customizedcast.setAlert("今日天气", "", "今日可能下雨🌂");
customizedcast.setBadge(0);
customizedcast.setSound("default");
// TODO set 'production_mode' to 'true' if your app is under production mode
customizedcast.setTestMode();
client.send(customizedcast);
}
IOSCustomizedcast customizedcast = new IOSCustomizedcast(appkey, appMasterSecret);
// Set your alias and alias_type here, and use comma to split them if there are multiple alias.
// And if you have many alias, you can also upload a file containing these alias, then
// use file_id to send customized notification.
customizedcast.setAlias("alias", "alias_type");
//customizedcast.setAlert("IOS 个性化测试");
//alert的值设置为字典
customizedcast.setAlert("今日天气", "", "今日可能下雨🌂");
customizedcast.setBadge(0);
customizedcast.setSound("default");
// set 'production_mode' to 'true' if your app is under production mode
customizedcast.setTestMode();
client.send(customizedcast);
}
public void sendIOSFilecast() throws Exception {
IOSFilecast filecast = new IOSFilecast(appkey, appMasterSecret);
// TODO upload your device tokens, and use '\n' to split them if there are multiple tokens
String fileId = client.uploadContents(appkey, appMasterSecret, "aa" + "\n" + "bb");
filecast.setFileId(fileId);
//filecast.setAlert("IOS 文件播测试");
//alert的值设置为字典
filecast.setAlert("今日天气", "", "今日可能下雨🌂");
filecast.setBadge(0);
filecast.setSound("default");
// TODO set 'production_mode' to 'true' if your app is under production mode
filecast.setTestMode();
client.send(filecast);
}
IOSFilecast filecast = new IOSFilecast(appkey, appMasterSecret);
// upload your device tokens, and use '\n' to split them if there are multiple tokens
String fileId = client.uploadContents(appkey, appMasterSecret, "aa" + "\n" + "bb");
filecast.setFileId(fileId);
//filecast.setAlert("IOS 文件播测试");
//alert的值设置为字典
filecast.setAlert("今日天气", "", "今日可能下雨🌂");
filecast.setBadge(0);
filecast.setSound("default");
// set 'production_mode' to 'true' if your app is under production mode
filecast.setTestMode();
client.send(filecast);
}
}
......
......@@ -2,9 +2,9 @@ package com.sien.common.service;
import com.sien.common.entity.AppUser;
import com.sien.common.param.AppUserPageParam;
import com.sien.common.vo.AppUserQueryVo;
import com.sien.common.param.app.AppSmsRegisterParam;
import com.sien.common.param.app.DeviceTokenParam;
import com.sien.common.vo.AppUserQueryVo;
import com.sien.common.vo.app.LoginAppUserTokenVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.service.BaseService;
......@@ -84,22 +84,29 @@ public interface AppUserService extends BaseService<AppUser> {
*/
boolean deleteAppUser(Long id) throws Exception;
/**
* 根据ID获取查询对象
*
* @param id
* @return
* @throws Exception
*/
AppUserQueryVo getAppUserById(Long id) throws Exception;
/**
* 根据ID获取查询对象
*
* @param id
* @return
* @throws Exception
*/
AppUserQueryVo getAppUserById(Long id) throws Exception;
/**
* 获取分页对象
*
* @param appUserPageParam
* @return
* @throws Exception
*/
Paging<AppUserQueryVo> getAppUserPageList(AppUserPageParam appUserPageParam) throws Exception;
/**
* 获取自己的信息详情
*/
AppUserQueryVo getMyInfo() throws Exception;
/**
* 获取分页对象
*
* @param appUserPageParam
* @return
* @throws Exception
*/
Paging<AppUserQueryVo> getAppUserPageList(AppUserPageParam appUserPageParam) throws Exception;
}
......@@ -2,8 +2,9 @@ package com.sien.common.service;
import com.sien.common.entity.DonationRecord;
import com.sien.common.param.DonationRecordPageParam;
import io.geekidea.springbootplus.framework.common.service.BaseService;
import com.sien.common.vo.DonationRankAndTotal;
import com.sien.common.vo.DonationRecordQueryVo;
import io.geekidea.springbootplus.framework.common.service.BaseService;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
/**
......@@ -14,6 +15,15 @@ import io.geekidea.springbootplus.framework.core.pagination.Paging;
*/
public interface DonationRecordService extends BaseService<DonationRecord> {
/**
* 查询捐款排名和总捐款
*
* @param userId
* @return
*/
DonationRankAndTotal getDonationRankAndTotal(Long userId);
/**
* 保存
*
......@@ -21,7 +31,7 @@ public interface DonationRecordService extends BaseService<DonationRecord> {
* @return
* @throws Exception
*/
boolean saveDonationRecord(DonationRecord donationRecord)throws Exception;
boolean saveDonationRecord(DonationRecord donationRecord) throws Exception;
/**
* 修改
......
......@@ -88,14 +88,13 @@ public class AppSmsServiceImpl implements AppSmsService {
*/
private ApiResult<Object> getSmsCodeApiResult(String key, String area, String number) {
// 生成验证码code
// 生成验证码code
String randomCode = getRandomCode();
// 过期时间(秒)
long expire = 120L;
Duration expireDuration = Duration.ofSeconds(expire);
// 存至redis
redisTemplate.opsForValue().set(key, randomCode, expireDuration);
SmsCode smsCode = new SmsCode();
......
......@@ -8,10 +8,10 @@ import com.sien.common.entity.AppUser;
import com.sien.common.enums.StateEnum;
import com.sien.common.mapper.AppUserMapper;
import com.sien.common.param.AppUserPageParam;
import com.sien.common.vo.AppUserQueryVo;
import com.sien.common.param.app.AppSmsRegisterParam;
import com.sien.common.param.app.DeviceTokenParam;
import com.sien.common.service.AppUserService;
import com.sien.common.vo.AppUserQueryVo;
import com.sien.common.vo.app.LoginAppUserTokenVo;
import io.geekidea.springbootplus.config.properties.JwtProperties;
import io.geekidea.springbootplus.config.properties.SpringBootPlusProperties;
......@@ -143,7 +143,7 @@ public class AppUserServiceImpl extends BaseServiceImpl<AppUserMapper, AppUser>
LoginAppUserTokenVo loginAppUserTokenVo = new LoginAppUserTokenVo();
BeanUtils.copyProperties(appUser, loginAppUserTokenVo);
loginAppUserTokenVo.setToken(token);
loginAppUserTokenVo.setId(appUser.getId());
// loginAppUserTokenVo.setId(appUser.getId());
loginAppUserTokenVo.setHasRegister(hasRegister);
return ApiResult.ok(loginAppUserTokenVo);
......@@ -191,6 +191,13 @@ public class AppUserServiceImpl extends BaseServiceImpl<AppUserMapper, AppUser>
}
@Override
public AppUserQueryVo getMyInfo() throws Exception {
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
AppUserQueryVo appUserById = appUserMapper.getAppUserById(jwtToken.getUserId());
return appUserById;
}
@Override
public Paging<AppUserQueryVo> getAppUserPageList(AppUserPageParam appUserPageParam) throws Exception {
Page<AppUserQueryVo> page = new PageInfo<>(appUserPageParam, OrderItem.desc(getLambdaColumn(AppUser::getCreateTime)));
IPage<AppUserQueryVo> iPage = appUserMapper.getAppUserPageList(page, appUserPageParam);
......
package com.sien.common.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sien.common.entity.DonationRecord;
import com.sien.common.mapper.DonationRecordMapper;
import com.sien.common.param.DonationRecordPageParam;
import com.sien.common.service.DonationRecordService;
import com.sien.common.param.DonationRecordPageParam;
import com.sien.common.vo.DonationRecordQueryVo;
import com.sien.common.vo.DonationRankAndTotal;
import com.sien.common.vo.DonationRecordQueryVo;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.core.pagination.PageInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.transaction.annotation.Transactional;
import io.geekidea.springbootplus.framework.core.pagination.PageInfo;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* 捐款记录 服务实现类
......@@ -26,37 +27,42 @@ import org.springframework.beans.factory.annotation.Autowired;
@Service
public class DonationRecordServiceImpl extends BaseServiceImpl<DonationRecordMapper, DonationRecord> implements DonationRecordService {
@Autowired
private DonationRecordMapper donationRecordMapper;
@Autowired
private DonationRecordMapper donationRecordMapper;
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveDonationRecord(DonationRecord donationRecord)throws Exception{
@Override
public DonationRankAndTotal getDonationRankAndTotal(Long userId) {
return donationRecordMapper.getDonationRankAndTotal(userId);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveDonationRecord(DonationRecord donationRecord) throws Exception {
return super.save(donationRecord);
}
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateDonationRecord(DonationRecord donationRecord)throws Exception{
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateDonationRecord(DonationRecord donationRecord) throws Exception {
return super.updateById(donationRecord);
}
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteDonationRecord(Long id)throws Exception{
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteDonationRecord(Long id) throws Exception {
return super.removeById(id);
}
}
@Override
public DonationRecordQueryVo getDonationRecordById(Long id) throws Exception {
return donationRecordMapper.getDonationRecordById(id);
}
@Override
public DonationRecordQueryVo getDonationRecordById(Long id)throws Exception{
return donationRecordMapper.getDonationRecordById(id);
}
@Override
public Paging<DonationRecordQueryVo> getDonationRecordPageList(DonationRecordPageParam donationRecordPageParam)throws Exception{
Page<DonationRecordQueryVo> page=new PageInfo<>(donationRecordPageParam,OrderItem.desc(getLambdaColumn(DonationRecord::getCreateTime)));
IPage<DonationRecordQueryVo> iPage= donationRecordMapper.getDonationRecordPageList(page, donationRecordPageParam);
public Paging<DonationRecordQueryVo> getDonationRecordPageList(DonationRecordPageParam donationRecordPageParam) throws Exception {
Page<DonationRecordQueryVo> page = new PageInfo<>(donationRecordPageParam, OrderItem.desc(getLambdaColumn(DonationRecord::getCreateTime)));
IPage<DonationRecordQueryVo> iPage = donationRecordMapper.getDonationRecordPageList(page, donationRecordPageParam);
return new Paging<DonationRecordQueryVo>(iPage);
}
}
}
}
......@@ -6,11 +6,10 @@ import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* <pre>
* 系统用户 查询结果对象
* 用户 查询结果对象
* </pre>
*
* @author hewei
......@@ -20,10 +19,6 @@ import java.util.Date;
@Accessors(chain = true)
@ApiModel(value = "AppUserQueryVo对象")
public class AppUserQueryVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键")
private Long id;
@ApiModelProperty("用户名")
private String username;
......@@ -40,12 +35,6 @@ public class AppUserQueryVo implements Serializable {
@ApiModelProperty("民族")
private String nation;
@ApiModelProperty("密码")
private String password;
@ApiModelProperty("盐值")
private String salt;
@ApiModelProperty("手机号码")
private String phone;
......@@ -64,18 +53,6 @@ public class AppUserQueryVo implements Serializable {
@ApiModelProperty("状态,0:禁用,1:启用,2:锁定")
private Integer state;
@ApiModelProperty("逻辑删除,0:未删除,1:已删除")
private Integer deleted;
@ApiModelProperty("版本")
private Integer version;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("修改时间")
private Date updateTime;
@ApiModelProperty("出生日期")
private String dateOfBirth;
......@@ -99,4 +76,6 @@ public class AppUserQueryVo implements Serializable {
@ApiModelProperty("紧急电话")
private String emergencyPhone;
}
\ No newline at end of file
package com.sien.common.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class DonationRankAndTotal implements Serializable {
@ApiModelProperty("总捐款金额")
private BigDecimal drTotal;
@ApiModelProperty("排名")
private Long rank;
}
......@@ -34,32 +34,24 @@ public class LoginAppUserTokenVo implements LoginToken {
@ApiModelProperty("token")
private String token;
@ApiModelProperty("主键")
private Long id;
// @ApiModelProperty("用户名")
// private String username;
@ApiModelProperty("是否已经注册, true = 已经注册, false = 没有注册")
private Boolean hasRegister;
@ApiModelProperty("姓")
private String surname;
@ApiModelProperty("名")
private String name;
@ApiModelProperty("用户名")
private String username;
@ApiModelProperty("公司名")
private String companyName;
@ApiModelProperty("微信id")
private String wechatOpenId;
@ApiModelProperty("微信号")
private String wechat;
@ApiModelProperty("姓名")
private String nickname;
@ApiModelProperty("出生日期")
private String dateOfBirth;
@ApiModelProperty("证件号码")
private String idcard;
// @ApiModelProperty("昵称")
// private String nickname;
@ApiModelProperty("民族")
private String nation;
@ApiModelProperty("手机号码")
private String phone;
......@@ -72,4 +64,35 @@ public class LoginAppUserTokenVo implements LoginToken {
@ApiModelProperty("头像")
private String head;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("状态,0:禁用,1:启用,2:锁定")
private Integer state;
@ApiModelProperty("出生日期")
private String dateOfBirth;
@ApiModelProperty("文化程度")
private String educationBackground;
@ApiModelProperty("邮件")
private String email;
@ApiModelProperty("省市区")
private String location;
@ApiModelProperty("详细地址")
private String locationDetail;
@ApiModelProperty("职业")
private String profession;
@ApiModelProperty("工作单位")
private String company;
@ApiModelProperty("紧急电话")
private String emergencyPhone;
}
......@@ -4,7 +4,8 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, fk_user_id, money, purpose, way, remark, create_time, update_time, is_replace
id
, fk_user_id, money, purpose, way, remark, create_time, update_time, is_replace
</sql>
<select id="getDonationRecordById" resultType="com.sien.common.vo.DonationRecordQueryVo">
......@@ -13,10 +14,20 @@
from donation_record where id = #{id}
</select>
<select id="getDonationRecordPageList" parameterType="com.sien.common.param.DonationRecordPageParam" resultType="com.sien.common.vo.DonationRecordQueryVo">
select
<include refid="Base_Column_List"/>
from donation_record
</select>
<select id="getDonationRecordPageList" parameterType="com.sien.common.param.DonationRecordPageParam"
resultType="com.sien.common.vo.DonationRecordQueryVo">
select
<include refid="Base_Column_List"/>
from donation_record
</select>
<select id="getDonationRankAndTotal" resultType="com.sien.common.vo.DonationRankAndTotal">
SELECT tb.*,
@curRank := @curRank + 1 AS rank
FROM
( SELECT fk_user_id, sum ( money ) AS dr_total FROM donation_record GROUP BY fk_user_id ORDER BY dr_total DESC ) AS tb,
( SELECT @curRank := 0 ) r
WHERE
fk_user_id = #{userId}
</select>
</mapper>
......@@ -183,11 +183,8 @@ spring-boot-plus:
# 权限配置
anon:
# 排除登录 注册 登出
- /app/user/registerOrLogin,/app/user/login
- /sys/login,/sys/logout,/sys/register
- /merchant/user/login,/merchant/user/register
- /app/sms/registerOrLoginCode,/merchant/sms/registerCode
- /app/versionControl/lastOne/**
- /user/registerOrLogin,/user/login
- /sms/registerOrLoginCode
# 排除静态资源
- /static/**,/templates/**
# 排除Swagger
......@@ -196,15 +193,7 @@ spring-boot-plus:
# - /actuator/**
- # 排除首页
- /,/index.html
- /app/noRole,/merchant/hello/world
# 航空公司介绍分页列表
- /app/airline/getPageList
# 公务机出售托管表分页列表
- /app/businessPlain/getPageList
# 包机介绍分页列表
- /app/charterIntroduction/getPageList
# 优惠调机列表分页查询
- /app/strokeDiscount/getPageList
# 多行字符串权限配置
filter-chain-definitions: |
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment