Commit 03f43c6f by giaogiao

生成测试appkey与appSecret对,并存入数据库

parent 8430754d
...@@ -3,11 +3,14 @@ package io.geekidea.springbootplus; ...@@ -3,11 +3,14 @@ package io.geekidea.springbootplus;
import com.wecloud.im.tillo.netty.core.NettyStart; import com.wecloud.im.tillo.netty.core.NettyStart;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner; import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
@Component @Component
@Order(value = 1)//这里表示启动顺序
public class StartNettyService implements CommandLineRunner { public class StartNettyService implements CommandLineRunner {
@Value("${netty.port}") @Value("${netty.port}")
private int port; private int port;
...@@ -16,9 +19,9 @@ public class StartNettyService implements CommandLineRunner { ...@@ -16,9 +19,9 @@ public class StartNettyService implements CommandLineRunner {
private NettyStart nettyServer; private NettyStart nettyServer;
@Override @Override
@Async//注意这里,组件启动时会执行run,这个注解是让线程异步执行,这样不影响主线程
public void run(String... args) throws Exception { public void run(String... args) throws Exception {
nettyServer.run(port); nettyServer.run(port);
} }
} }
package io.geekidea.springbootplus.test; package io.geekidea.springbootplus.test;
import cn.hutool.core.lang.Snowflake;
import com.wecloud.im.entity.ImApplication;
import com.wecloud.im.service.ImApplicationService;
import com.wecloud.im.tillo.app_ws.utils.RSAGenerator; import com.wecloud.im.tillo.app_ws.utils.RSAGenerator;
import io.geekidea.springbootplus.SpringBootPlusApplication; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringRunner.class) import java.util.Date;
@SpringBootTest(classes = SpringBootPlusApplication.class)
/**
* 生成测试appkey与appSecret对,并存入数据库
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
public class AppKeyTest { public class AppKeyTest {
public static void main(String[] args) { public static void main(String[] args) {
String appKey = RSAGenerator.getAppKey(); //定义变量接收 String appKey = RSAGenerator.getAppKey(); //定义变量接收
String appSecret = RSAGenerator.getAppSecret(appKey); String appSecret = RSAGenerator.getAppSecret(appKey);
int i=1; int i = 1;
} }
@Autowired
private ImApplicationService imApplicationService;
@Test
public void add() {
for (int i = 0; i < 10000; i++) {
addDb(i);
}
}
private void addDb( int i) {
String appKey = RSAGenerator.getAppKey(); //定义变量接收
String appSecret = RSAGenerator.getAppSecret(appKey);
ImApplication imApplication = new ImApplication();
imApplication.setCreateTime(new Date());
imApplication.setUpdateTime(new Date());
imApplication.setId(new Snowflake(1L,1L).nextId());
imApplication.setAppKey(appKey);
imApplication.setAppSecret(appSecret);
imApplication.setAppName("test"+i);
imApplicationService.save(imApplication);
}
} }
package com.wecloud.im.controller;
import com.wecloud.im.entity.ImApplication;
import com.wecloud.im.param.ImApplicationPageParam;
import com.wecloud.im.param.ImApplicationQueryVo;
import com.wecloud.im.service.ImApplicationService;
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;
/**
* 第三方应用表 控制器
*
* @author wei
* @since 2021-04-27
*/
@Slf4j
@RestController
@RequestMapping("/imApplication")
@Api(value = "第三方应用表API", tags = {"第三方应用表"})
public class ImApplicationController extends BaseController {
@Autowired
private ImApplicationService imApplicationService;
/**
* 添加第三方应用表
*/
@PostMapping("/add")
@OperationLog(name = "添加第三方应用表", type = OperationLogType.ADD)
@ApiOperation(value = "添加第三方应用表")
public ApiResult<Boolean> addImApplication(@Validated(Add.class) @RequestBody ImApplication imApplication) throws Exception {
boolean flag = imApplicationService.saveImApplication(imApplication);
return ApiResult.result(flag);
}
/**
* 修改第三方应用表
*/
@PostMapping("/update")
@OperationLog(name = "修改第三方应用表", type = OperationLogType.UPDATE)
@ApiOperation(value = "修改第三方应用表")
public ApiResult<Boolean> updateImApplication(@Validated(Update.class) @RequestBody ImApplication imApplication) throws Exception {
boolean flag = imApplicationService.updateImApplication(imApplication);
return ApiResult.result(flag);
}
/**
* 删除第三方应用表
*/
@PostMapping("/delete/{id}")
@OperationLog(name = "删除第三方应用表", type = OperationLogType.DELETE)
@ApiOperation(value = "删除第三方应用表")
public ApiResult<Boolean> deleteImApplication(@PathVariable("id") Long id) throws Exception {
boolean flag = imApplicationService.deleteImApplication(id);
return ApiResult.result(flag);
}
/**
* 获取第三方应用表详情
*/
@GetMapping("/info/{id}")
@OperationLog(name = "第三方应用表详情", type = OperationLogType.INFO)
@ApiOperation(value = "第三方应用表详情")
public ApiResult<ImApplicationQueryVo> getImApplication(@PathVariable("id") Long id) throws Exception {
ImApplicationQueryVo imApplicationQueryVo = imApplicationService.getImApplicationById(id);
return ApiResult.ok(imApplicationQueryVo);
}
/**
* 第三方应用表分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "第三方应用表分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "第三方应用表分页列表")
public ApiResult<Paging<ImApplicationQueryVo>> getImApplicationPageList(@Validated @RequestBody ImApplicationPageParam imApplicationPageParam) throws Exception {
Paging<ImApplicationQueryVo> paging = imApplicationService.getImApplicationPageList(imApplicationPageParam);
return ApiResult.ok(paging);
}
}
package com.wecloud.im.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* 系统用户
*
* @author hewei
* @since 2021-02-25
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "AppUser对象")
public class AppUser extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "id不能为空", groups = {Update.class})
@ApiModelProperty("主键")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty("用户名")
private String username;
@ApiModelProperty("微信id")
private String wechatOpenId;
@ApiModelProperty("姓名")
private String nickname;
@ApiModelProperty("证件号码")
private String idcard;
@ApiModelProperty("民族")
private String nation;
@ApiModelProperty("密码")
private String password;
@ApiModelProperty("盐值")
private String salt;
@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("逻辑删除,0:未删除,1:已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty("版本")
@Version
private Integer version;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("修改时间")
private Date updateTime;
@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;
}
package com.wecloud.im.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* 第三方应用表
*
* @author wei
* @since 2021-04-27
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "ImApplication对象")
public class ImApplication extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "应用appid不能为空")
@ApiModelProperty("应用appid")
@TableId(value = "id", type = IdType.INPUT)
private Long id;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("修改时间")
private Date updateTime;
@ApiModelProperty("key")
private String appKey;
@ApiModelProperty("密钥")
private String appSecret;
@ApiModelProperty("app名称")
private String appName;
}
package com.wecloud.im.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.wecloud.im.entity.ImApplication;
import com.wecloud.im.param.ImApplicationPageParam;
import com.wecloud.im.param.ImApplicationQueryVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.io.Serializable;
/**
* 第三方应用表 Mapper 接口
*
* @author wei
* @since 2021-04-27
*/
@Repository
public interface ImApplicationMapper extends BaseMapper<ImApplication> {
/**
* 根据ID获取查询对象
*
* @param id
* @return
*/
ImApplicationQueryVo getImApplicationById(Serializable id);
/**
* 获取分页对象
*
* @param page
* @param imApplicationPageParam
* @return
*/
IPage<ImApplicationQueryVo> getImApplicationPageList(@Param("page") Page page, @Param("param") ImApplicationPageParam imApplicationPageParam);
}
package com.wecloud.im.param;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
/**
* <pre>
* 系统用户 分页参数对象
* </pre>
*
* @author hewei
* @date 2021-02-25
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "系统用户分页参数")
public class AppUserPageParam extends BasePageOrderParam{
private static final long serialVersionUID=1L;
}
package com.wecloud.im.param;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
/**
* <pre>
* 替他人捐款记录表 分页参数对象
* </pre>
*
* @author hewei
* @date 2021-02-25
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "替他人捐款记录表分页参数")
public class DonationAgentPageParam extends BasePageOrderParam{
private static final long serialVersionUID=1L;
}
...@@ -8,16 +8,16 @@ import lombok.experimental.Accessors; ...@@ -8,16 +8,16 @@ import lombok.experimental.Accessors;
/** /**
* <pre> * <pre>
* 捐款记录 分页参数对象 * 第三方应用表 分页参数对象
* </pre> * </pre>
* *
* @author hewei * @author wei
* @date 2021-02-25 * @date 2021-04-27
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value = "捐款记录分页参数") @ApiModel(value = "第三方应用表分页参数")
public class DonationRecordPageParam extends BasePageOrderParam { public class ImApplicationPageParam extends BasePageOrderParam {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
package com.wecloud.im.vo; package com.wecloud.im.param;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -10,33 +10,33 @@ import java.util.Date; ...@@ -10,33 +10,33 @@ import java.util.Date;
/** /**
* <pre> * <pre>
* 替他人捐款记录表 查询结果对象 * 第三方应用表 查询结果对象
* </pre> * </pre>
* *
* @author hewei * @author wei
* @date 2021-02-25 * @date 2021-04-27
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value = "DonationAgentQueryVo对象") @ApiModel(value = "ImApplicationQueryVo对象")
public class DonationAgentQueryVo implements Serializable { public class ImApplicationQueryVo implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty("主键") @ApiModelProperty("应用appid")
private Long id; private Long id;
@ApiModelProperty("外键_捐款人_用户表id")
private Long fkUserId;
@ApiModelProperty("外键_捐款表id")
private Long fkRecordId;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
private Date createTime; private Date createTime;
@ApiModelProperty("修改时间") @ApiModelProperty("修改时间")
private Date updateTime; private Date updateTime;
@ApiModelProperty("key")
private String appKey;
@ApiModelProperty("密钥")
private String appSecret;
@ApiModelProperty("app名称")
private String appName;
} }
\ No newline at end of file
/*
* Copyright 2019-2029 geekidea(https://github.com/geekidea)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.wecloud.im.param;
import io.geekidea.springbootplus.framework.shiro.service.LoginUsername;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 登录参数
*
* @author geekidea
* @date 2019-05-15
**/
@Data
@ApiModel("登录参数")
public class MerchantLoginParam implements LoginUsername {
private static final long serialVersionUID = 2854217576695117356L;
@NotBlank(message = "请输入账号")
@ApiModelProperty(value = "账号", example = "zhuomeiya")
private String username;
@NotBlank(message = "请输入密码")
@ApiModelProperty(value = "密码", example = "123456")
private String password;
}
/*
* Copyright 2019-2029 geekidea(https://github.com/geekidea)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.wecloud.im.param.app;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 登录参数
*
* @author geekidea
* @date 2019-05-15
**/
@Data
@ApiModel("登录参数")
public class AppLoginParam implements Serializable {
private static final long serialVersionUID = 2854217576695117356L;
private String area;
private String number;
@ApiModelProperty("验证码")
private String code;
}
/*
* Copyright 2019-2029 geekidea(https://github.com/geekidea)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.wecloud.im.param.app;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 注册参数
*
* @author geekidea
* @date 2019-05-15
**/
@Data
@ApiModel("AppSmsRegisterParam")
@Validated
public class AppSmsRegisterParam implements Serializable {
@NotBlank(message = "姓名")
@ApiModelProperty(value = "用户姓名", example = "何", required = true)
private String userName;
@NotBlank(message = "请输入手机区号")
@ApiModelProperty(value = "手机区号", example = "86", required = true)
private String phoneArea;
@NotBlank(message = "请输入手机号")
@ApiModelProperty(value = "手机号", example = "17621701100", required = true)
private String phone;
@ApiModelProperty(value = "短信验证码", example = "666666", required = true)
@NotBlank(message = "请输入手机号")
private String smsCode;
@ApiModelProperty(value = "check接口中返回的openId", example = "adfadlsfadsf")
@NotBlank(message = "请输入openId")
private String openId;
}
package com.wecloud.im.param.app;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* APP用户
*
* @author wei
* @since 2020-09-23
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "AppUserInfoParam对象")
public class AppUserInfoParam extends BaseEntity {
@ApiModelProperty("用户姓名")
private String username;
@ApiModelProperty("微信id")
private String wechatOpenId;
@ApiModelProperty("微信昵称")
private String nickname;
@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;
@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;
}
package com.wecloud.im.param.app;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* APP用户
*
* @author wei
* @since 2020-09-23
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "AppUserPhoneUpdateParam")
public class AppUserPhoneUpdateParam extends BaseEntity {
@ApiModelProperty("新手机区号")
private String phoneArea;
@ApiModelProperty("新手机号")
private String phone;
@ApiModelProperty("旧手机号的验证码")
private String code;
@ApiModelProperty("新手机号的验证码")
private String codeNew;
}
package com.wecloud.im.param.app;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class DeviceTokenParam implements Serializable {
private String deviceToken;
@ApiModelProperty("ios=2, android=1")
private int deviceType;
}
package com.wecloud.im.param.app;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 捐款记录
*
* @author hewei
* @since 2021-02-25
*/
@Data
public class DonationRecordAdd implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "捐款金额", required = true)
private BigDecimal money;
@ApiModelProperty(value = "捐款用途;直接录入字符串: 助学助教,资助病残;慰问孤老,其他", required = true)
private String purpose;
@ApiModelProperty(value = "捐款方式;1正常,2匿名", required = true)
private Integer way;
@ApiModelProperty(value = "是否替别人捐款,1是,0不是", required = true)
private Integer isReplace;
@ApiModelProperty("捐款接收用户手机号,isReplace=1时必传")
private String userPhone;
@ApiModelProperty("手机区号,isReplace=1时必传")
private String phoneArea;
}
package com.wecloud.im.service;
import com.wecloud.im.entity.ImApplication;
import com.wecloud.im.param.ImApplicationPageParam;
import com.wecloud.im.param.ImApplicationQueryVo;
import io.geekidea.springbootplus.framework.common.service.BaseService;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
/**
* 第三方应用表 服务类
*
* @author wei
* @since 2021-04-27
*/
public interface ImApplicationService extends BaseService<ImApplication> {
/**
* 保存
*
* @param imApplication
* @return
* @throws Exception
*/
boolean saveImApplication(ImApplication imApplication) throws Exception;
/**
* 修改
*
* @param imApplication
* @return
* @throws Exception
*/
boolean updateImApplication(ImApplication imApplication) throws Exception;
/**
* 删除
*
* @param id
* @return
* @throws Exception
*/
boolean deleteImApplication(Long id) throws Exception;
/**
* 根据ID获取查询对象
*
* @param id
* @return
* @throws Exception
*/
ImApplicationQueryVo getImApplicationById(Long id) throws Exception;
/**
* 获取分页对象
*
* @param imApplicationPageParam
* @return
* @throws Exception
*/
Paging<ImApplicationQueryVo> getImApplicationPageList(ImApplicationPageParam imApplicationPageParam) throws Exception;
}
package com.wecloud.im.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.wecloud.im.entity.ImApplication;
import com.wecloud.im.mapper.ImApplicationMapper;
import com.wecloud.im.param.ImApplicationPageParam;
import com.wecloud.im.param.ImApplicationQueryVo;
import com.wecloud.im.service.ImApplicationService;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import io.geekidea.springbootplus.framework.core.pagination.PageInfo;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* 第三方应用表 服务实现类
*
* @author wei
* @since 2021-04-27
*/
@Slf4j
@Service
public class ImApplicationServiceImpl extends BaseServiceImpl<ImApplicationMapper, ImApplication> implements ImApplicationService {
@Autowired
private ImApplicationMapper imApplicationMapper;
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveImApplication(ImApplication imApplication) throws Exception {
return super.save(imApplication);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateImApplication(ImApplication imApplication) throws Exception {
return super.updateById(imApplication);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteImApplication(Long id) throws Exception {
return super.removeById(id);
}
@Override
public ImApplicationQueryVo getImApplicationById(Long id) throws Exception {
return imApplicationMapper.getImApplicationById(id);
}
@Override
public Paging<ImApplicationQueryVo> getImApplicationPageList(ImApplicationPageParam imApplicationPageParam) throws Exception {
Page<ImApplicationQueryVo> page = new PageInfo<>(imApplicationPageParam, OrderItem.desc(getLambdaColumn(ImApplication::getCreateTime)));
IPage<ImApplicationQueryVo> iPage = imApplicationMapper.getImApplicationPageList(page, imApplicationPageParam);
return new Paging<ImApplicationQueryVo>(iPage);
}
}
package com.wecloud.im.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <pre>
* 用户 查询结果对象
* </pre>
*
* @author hewei
* @date 2021-02-25
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "AppUserQueryVo")
public class AppUserQueryVo implements Serializable {
@ApiModelProperty("用户姓名")
private String username;
@ApiModelProperty("微信id")
private String wechatOpenId;
@ApiModelProperty("微信昵称")
private String nickname;
@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;
@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;
}
\ No newline at end of file
package com.wecloud.im.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;
}
package com.wecloud.im.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* <pre>
* 捐款记录 查询结果对象
* </pre>
*
* @author hewei
* @date 2021-02-25
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "DonationRecordQueryVo对象")
public class DonationRecordQueryVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键")
private Long id;
//
// @ApiModelProperty("捐款人id")
// private Long fkUserId;
@ApiModelProperty("捐款金额")
private BigDecimal money;
@ApiModelProperty("捐款用途;直接录入字符串: 助学助教,资助病残;慰问孤老,其他")
private String purpose;
@ApiModelProperty("捐款方式;1正常.2匿名,替他人捐款记录在donation_r agent表")
private Integer way;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("创建时间")
private Date createTime;
// @ApiModelProperty("修改时间")
// private Date updateTime;
@ApiModelProperty("是否为别人替我捐款")
private Integer isReplace;
}
\ No newline at end of file
/*
* Copyright 2019-2029 geekidea(https://github.com/geekidea)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.wecloud.im.vo;
import io.geekidea.springbootplus.framework.shiro.service.LoginToken;
import io.geekidea.springbootplus.framework.shiro.vo.LoginUserVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* @author geekidea
* @date 2019-10-26
**/
@Data
@Accessors(chain = true)
@ApiModel("登录用户信息TokenVO")
public class LoginMerUserTokenVo implements LoginToken {
private static final long serialVersionUID = -2138450422989081056L;
@ApiModelProperty("token")
private String token;
@ApiModelProperty("是否为管理员,0:普通,1:超级管理员")
private Integer isAdmin;
@ApiModelProperty("商户ID")
private Long merchantId;
@ApiModelProperty("商户name")
private String merchantName;
/**
* 登录用户对象
*/
private LoginUserVo loginSysUserVo;
}
/*
* Copyright 2019-2029 geekidea(https://github.com/geekidea)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.wecloud.im.vo;
import io.geekidea.springbootplus.framework.shiro.service.LoginToken;
import io.geekidea.springbootplus.framework.shiro.vo.LoginUserVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* @author geekidea
* @date 2019-10-26
**/
@Data
@Accessors(chain = true)
@ApiModel("登录用户信息TokenVO")
public class LoginSysUserTokenVo implements LoginToken {
private static final long serialVersionUID = -2138450422989081056L;
@ApiModelProperty("token")
private String token;
/**
* 登录用户对象
*/
private LoginUserVo loginSysUserVo;
}
package com.wecloud.im.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <pre>
* 飞机型号表 查询结果对象
* </pre>
*
* @author wei
* @date 2020-10-09
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "PlainTypeQueryVo对象")
public class PlainTypeQueryVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键ID")
private Long id;
@ApiModelProperty("系列类型,0-尊享系列 , 1-奢享系列 ,2-普通系列")
private Integer seriesType;
@ApiModelProperty("飞机名称")
private String name;
@ApiModelProperty("飞机图片地址")
private String imgUrl;
@ApiModelProperty("状态,0-正常,1-禁用,99-删除")
private Integer status;
@ApiModelProperty("创建时间(时间戳)")
private Long createTime;
@ApiModelProperty("更新时间(时间戳)")
private Long updateTime;
}
package com.wecloud.im.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class SmsCode implements Serializable {
private String smsCode;
}
package com.wecloud.im.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* <pre>
* 捐款记录 查询结果对象
* </pre>
*
* @author hewei
* @date 2021-02-25
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "VipRecordQueryVo对象")
public class VipRecordQueryVo implements Serializable{
private static final long serialVersionUID=1L;
@ApiModelProperty("主键")
private Long id;
@ApiModelProperty("外键_用户表")
private Long fkUserId;
@ApiModelProperty("开通人,因为可以给其他人开通,所以要有对应的谁给我充值的")
private Long fkRechargeUser;
@ApiModelProperty("开通会员金额")
private BigDecimal money;
@ApiModelProperty("到期时间")
private Date expiredAt;
@ApiModelProperty("开通多久")
private Integer years;
@ApiModelProperty("会员等级")
private String vipLevel;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("修改时间")
private Date updateTime;
}
\ No newline at end of file
/*
* Copyright 2019-2029 geekidea(https://github.com/geekidea)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.wecloud.im.vo.app;
import io.geekidea.springbootplus.framework.shiro.service.LoginToken;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* @author geekidea
* @date 2019-10-26
**/
@Data
@Accessors(chain = true)
@ApiModel("LoginAppUserTokenVo")
public class LoginAppUserTokenVo implements LoginToken {
@ApiModelProperty("token")
private String token;
@ApiModelProperty(value = "是否已经注册", notes = "true = 已经绑定,直接跳转个人中心, false = 没有绑定,需要跳转到注册页")
private Boolean hasRegister;
@ApiModelProperty("用户名")
private String username;
@ApiModelProperty("微信id")
private String wechatOpenId;
@ApiModelProperty("姓名")
private String nickname;
@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;
@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;
@ApiModelProperty("openId")
private String openId;
}
/*
* Copyright 2019-2029 geekidea(https://github.com/geekidea)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.wecloud.im.vo.app;
import com.wecloud.im.vo.AppUserQueryVo;
import com.wecloud.im.vo.DonationRankAndTotal;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* @author geekidea
* @date 2019-10-26
**/
@Data
@Accessors(chain = true)
@ApiModel("LoginAppUserTokenVo2")
public class MyInfoVo implements Serializable {
private AppUserQueryVo appUserQueryVo;
private DonationRankAndTotal donationRankAndTotal;
}
package com.wecloud.im.vo.app;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* <pre>
* 会员价格表 查询结果对象
* </pre>
*
* @author xxx
* @date 2021-03-11
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "VipPriceQueryVo对象")
public class VipPriceQueryVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("会员价格")
private BigDecimal price;
@ApiModelProperty("会员类型(名称)")
private String memberShips;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("修改时间")
private Date updateTime;
@ApiModelProperty("状态,0:禁用,1:启用")
private Integer state;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.wecloud.im.mapper.ImApplicationMapper">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id
, create_time, update_time, app_key, app_secret, app_name
</sql>
<select id="getImApplicationById" resultType="com.wecloud.im.param.ImApplicationQueryVo">
select
<include refid="Base_Column_List"/>
from im_application where id = #{id}
</select>
<select id="getImApplicationPageList" parameterType="com.wecloud.im.param.ImApplicationPageParam"
resultType="com.wecloud.im.param.ImApplicationQueryVo">
select
<include refid="Base_Column_List"/>
from im_application
</select>
</mapper>
...@@ -44,7 +44,7 @@ public class SpringBootPlusGenerator { ...@@ -44,7 +44,7 @@ public class SpringBootPlusGenerator {
// Scanner sc = new Scanner(System.in); // Scanner sc = new Scanner(System.in);
// System.out.println("请输入表名称:"); // System.out.println("请输入表名称:");
// String name = sc.nextLine(); // String name = sc.nextLine();
getCode("application"); getCode("im_application");
// getCode(name); // getCode(name);
} }
...@@ -54,9 +54,9 @@ public class SpringBootPlusGenerator { ...@@ -54,9 +54,9 @@ public class SpringBootPlusGenerator {
// 设置基本信息 // 设置基本信息
generatorProperties generatorProperties
.setMavenModuleName("common") .setMavenModuleName("common")
.setParentPackage("com.sien.common") .setParentPackage("com.wecloud.im")
// .setModuleName("api-app") // .setModuleName("api-app")
.setAuthor("xxx") // 设置作者名称 .setAuthor("wei") // 设置作者名称
.setFileOverride(true); .setFileOverride(true);
// 设置表信息 // 设置表信息
...@@ -68,9 +68,9 @@ public class SpringBootPlusGenerator { ...@@ -68,9 +68,9 @@ public class SpringBootPlusGenerator {
generatorProperties.getDataSourceConfig() generatorProperties.getDataSourceConfig()
.setDbType(DbType.MYSQL) .setDbType(DbType.MYSQL)
.setUsername("root") .setUsername("root")
.setPassword("temple123456") .setPassword("123")
.setDriverName("com.mysql.jdbc.Driver") .setDriverName("com.mysql.jdbc.Driver")
.setUrl("jdbc:mysql://47.99.47.225:3306/sien?useUnicode=true&characterEncoding=UTF-8&useSSL=false"); .setUrl("jdbc:mysql://localhost:3306/wecloud_im?useUnicode=true&characterEncoding=UTF-8&useSSL=false");
// 生成配置 // 生成配置
generatorProperties.getGeneratorConfig() generatorProperties.getGeneratorConfig()
......
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