diff --git a/pom.xml b/pom.xml
index 90bf48d..8d6a3fe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
4.122.9.01.2.13
- 3.1.2
+ 3.4.3.28.0.254.011.2.0.3
diff --git a/shapelight-admin/src/main/java/net/shapelight/common/config/MybatisPlusConfig.java b/shapelight-admin/src/main/java/net/shapelight/common/config/MybatisPlusConfig.java
index b8f1fb9..cb027f0 100644
--- a/shapelight-admin/src/main/java/net/shapelight/common/config/MybatisPlusConfig.java
+++ b/shapelight-admin/src/main/java/net/shapelight/common/config/MybatisPlusConfig.java
@@ -2,7 +2,11 @@
package net.shapelight.common.config;
-import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import com.baomidou.mybatisplus.annotation.DbType;
+import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.DynamicTableNameInnerInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
+import net.shapelight.common.interceptor.CustomizeTableNameHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -18,16 +22,28 @@ public class MybatisPlusConfig {
/**
* 分页插件
*/
+// 最新版
@Bean
- public PaginationInterceptor paginationInterceptor() {
- return new PaginationInterceptor();
+ public MybatisPlusInterceptor mybatisPlusInterceptor() {
+ MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
+ // 分页插件
+ interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
+ DynamicTableNameInnerInterceptor dynamicTableNameInnerInterceptor = new DynamicTableNameInnerInterceptor();
+ dynamicTableNameInnerInterceptor.setTableNameHandler(
+ //可以传多个表名参数,指定哪些表使用MonthTableNameHandler处理表名称
+ new CustomizeTableNameHandler("ten_person_extract")
+ );
+
+ //以拦截器的方式处理表名称
+ interceptor.addInnerInterceptor(dynamicTableNameInnerInterceptor);
+ return interceptor;
}
// @Bean
// public ISqlInjector sqlInjector() {
// return new LogicSqlInjector();
// }
-// @Bean
+/*// @Bean
// public PaginationInterceptor paginationInterceptor() {
// PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
// DynamicTableNameParser dynamicTableNameParser = new DynamicTableNameParser();
@@ -81,5 +97,5 @@ public class MybatisPlusConfig {
//// }});
//// paginationInterceptor.setSqlParserList(Collections.singletonList(dynamicTableNameParser));
// return paginationInterceptor;
-// }
+// }*/
}
diff --git a/shapelight-admin/src/main/java/net/shapelight/common/config/ShiroConfig.java b/shapelight-admin/src/main/java/net/shapelight/common/config/ShiroConfig.java
index 35357b2..e025de2 100644
--- a/shapelight-admin/src/main/java/net/shapelight/common/config/ShiroConfig.java
+++ b/shapelight-admin/src/main/java/net/shapelight/common/config/ShiroConfig.java
@@ -116,6 +116,7 @@ public class ShiroConfig {
filterMap.put("/webjars/**", "anon");
filterMap.put("/druid/**", "anon");
filterMap.put("/app/**", "anon");
+ filterMap.put("/parent/app/**", "anon");
filterMap.put("/api/**", "anon");
filterMap.put("/images/**", "anon");//网站上传的图片files
filterMap.put("/files/**", "anon");//网站上传的图片files
diff --git a/shapelight-admin/src/main/java/net/shapelight/common/interceptor/CustomizeTableNameHandler.java b/shapelight-admin/src/main/java/net/shapelight/common/interceptor/CustomizeTableNameHandler.java
new file mode 100644
index 0000000..0a3215a
--- /dev/null
+++ b/shapelight-admin/src/main/java/net/shapelight/common/interceptor/CustomizeTableNameHandler.java
@@ -0,0 +1,42 @@
+package net.shapelight.common.interceptor;
+
+import com.baomidou.mybatisplus.extension.plugins.handler.TableNameHandler;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 按自定义字段参数,组成动态表名
+ */
+public class CustomizeTableNameHandler implements TableNameHandler {
+ //用于记录哪些表可以使用该月份动态表名处理器(即哪些表可以分表)
+ private List tableNames;
+
+ //构造函数,构造动态表名处理器的时候,传递tableNames参数
+ public CustomizeTableNameHandler(String ...tableNames) {
+ this.tableNames = Arrays.asList(tableNames);
+ }
+
+ //每个请求线程维护一个分表字段数据,避免多线程数据冲突。所以使用ThreadLocal
+ private static final ThreadLocal CELL_DATA = new ThreadLocal<>();
+
+ //设置请求线程的month数据
+ public static void setData(String month) {
+ CELL_DATA.set(month);
+ }
+
+ //删除当前请求线程的month数据
+ public static void removeData() {
+ CELL_DATA.remove();
+ }
+
+ //动态表名接口实现方法
+ @Override
+ public String dynamicTableName(String sql, String tableName) {
+ if (this.tableNames.contains(tableName)){
+ return tableName + "_" + CELL_DATA.get(); //表名增加分表字段后缀
+ }else{
+ return tableName; //表名原样返回
+ }
+ }
+}
diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/app/config/WebMvcConfig.java b/shapelight-admin/src/main/java/net/shapelight/modules/app/config/WebMvcConfig.java
index 1bb269b..ddc3c25 100644
--- a/shapelight-admin/src/main/java/net/shapelight/modules/app/config/WebMvcConfig.java
+++ b/shapelight-admin/src/main/java/net/shapelight/modules/app/config/WebMvcConfig.java
@@ -2,6 +2,8 @@ package net.shapelight.modules.app.config;
import net.shapelight.modules.app.interceptor.AuthorizationInterceptor;
import net.shapelight.modules.app.resolver.LoginUserHandlerMethodArgumentResolver;
+import net.shapelight.modules.appparent.interceptor.ParentAuthorizationInterceptor;
+import net.shapelight.modules.appparent.resolver.ParentLoginUserHandlerMethodArgumentResolver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
@@ -18,15 +20,21 @@ public class WebMvcConfig implements WebMvcConfigurer {
@Autowired
private AuthorizationInterceptor authorizationInterceptor;
@Autowired
+ private ParentAuthorizationInterceptor parentAuthorizationInterceptor;
+ @Autowired
private LoginUserHandlerMethodArgumentResolver loginUserHandlerMethodArgumentResolver;
+ @Autowired
+ private ParentLoginUserHandlerMethodArgumentResolver parentLoginUserHandlerMethodArgumentResolver;
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(authorizationInterceptor).addPathPatterns("/app/**");
+ registry.addInterceptor(parentAuthorizationInterceptor).addPathPatterns("/parent/app/**");
}
@Override
public void addArgumentResolvers(List argumentResolvers) {
argumentResolvers.add(loginUserHandlerMethodArgumentResolver);
+ argumentResolvers.add(parentLoginUserHandlerMethodArgumentResolver);
}
}
\ No newline at end of file
diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/app/controller/AppApiController.java b/shapelight-admin/src/main/java/net/shapelight/modules/app/controller/AppApiController.java
index 4c38624..0c22742 100644
--- a/shapelight-admin/src/main/java/net/shapelight/modules/app/controller/AppApiController.java
+++ b/shapelight-admin/src/main/java/net/shapelight/modules/app/controller/AppApiController.java
@@ -550,7 +550,7 @@ public class AppApiController {
// if(tenPersonIdcard!=null){
// return R.error("身份证在此房间已存在");
// }
- List list = tenPersonService.findByIdCardAndDept(tenPerson.getIdCard(),tenPerson.getDeptId());
+ List list = tenPersonService.findByIdCardAndDept(tenPerson.getIdCard(),tenPerson.getDeptId(),tenPerson.getCellId());
if(list.size()>0){
return R.error("身份证在此组织已存在");
}
diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/config/WebMvcConfig.java b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/config/WebMvcConfig.java
deleted file mode 100644
index 39c54cc..0000000
--- a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/config/WebMvcConfig.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package net.shapelight.modules.appparent.config;
-
-import net.shapelight.modules.appparent.interceptor.AuthorizationInterceptor;
-import net.shapelight.modules.appparent.resolver.LoginUserHandlerMethodArgumentResolver;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.method.support.HandlerMethodArgumentResolver;
-import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-import java.util.List;
-
-/**
- * MVC配置
- */
-@Configuration
-public class WebMvcConfig implements WebMvcConfigurer {
- @Autowired
- private AuthorizationInterceptor authorizationInterceptor;
- @Autowired
- private LoginUserHandlerMethodArgumentResolver loginUserHandlerMethodArgumentResolver;
-
- @Override
- public void addInterceptors(InterceptorRegistry registry) {
- registry.addInterceptor(authorizationInterceptor).addPathPatterns("/app/**");
- }
-
- @Override
- public void addArgumentResolvers(List argumentResolvers) {
- argumentResolvers.add(loginUserHandlerMethodArgumentResolver);
- }
-}
\ No newline at end of file
diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppComm.java b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppComm.java
deleted file mode 100644
index f1fd2f7..0000000
--- a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppComm.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package net.shapelight.modules.appparent.controller;
-
-public class AppComm {
- public static int FLAG_DEVICE_ALART = 2;
- public static int FLAG_APP_TO_SERVER = 0;
- public static int FLAG_SERVER_TO_DEVICE = 1;
- public static int FLAG_RESPONSED = 3;
- public static int FLAG_ALERT_MSG_DELETE = 4;
- public static String STRING_ALEAM = "告警";
- public static String TYPE_MOVECAR = "movecar";
- public static String SIGNAL_STATUS_ON = "正常";
- public static String SIGNAL_STATUS_OFF = "离线";
- public static String SIGNAL_STATUS_ERROR = "异常";
- public static String SIGNAL_STATUS_INIT = "初始导入";
-
-}
diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppInfoApiController.java b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppInfoParentApiController.java
similarity index 85%
rename from shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppInfoApiController.java
rename to shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppInfoParentApiController.java
index 24be93e..c012d92 100644
--- a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppInfoApiController.java
+++ b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppInfoParentApiController.java
@@ -3,14 +3,10 @@ package net.shapelight.modules.appparent.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import io.minio.MinioClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
-import net.shapelight.common.config.GlobalValue;
-import net.shapelight.common.config.MinioConfig;
-import net.shapelight.common.utils.Constant;
import net.shapelight.common.utils.MyDateUtils;
import net.shapelight.common.utils.PageUtils;
import net.shapelight.common.utils.R;
@@ -36,7 +32,7 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("/parent/app")
@Api("APP接口")
-public class AppInfoApiController {
+public class AppInfoParentApiController {
@Autowired
private TenCellService tenCellService;
@@ -120,17 +116,14 @@ public class AppInfoApiController {
recordTimeEnd = MyDateUtils.getCurrentMonthEndTime();
}
params.put("recordTimeStart",recordTimeStart);
- params.put("recordTimeEnd",recordTimeEnd);
- List relationList = relationService.list(new LambdaQueryWrapper()
- .eq(TenRelation::getParentId,user.getUserId()).eq(TenRelation::getStatus,1));
- if(!relationList.isEmpty()) {
- List list = relationList.stream().map(TenRelation::getStudentId).collect(Collectors.toList());
- params.put("cellId",user.getCellId());
- params.put("personIds",list);
- PageUtils page = tenRecordService.getByPersonIds(params);
- return R.ok().put("data", page);
- }
- }
+ params.put("recordTimeEnd", recordTimeEnd);
+ TenRelation relation = relationService.getOne(new LambdaQueryWrapper()
+ .eq(TenRelation::getParentId, user.getUserId()).eq(TenRelation::getStudentId, params.get("studentId")).eq(TenRelation::getStatus, 1));
+ params.put("cellId", user.getCellId());
+ params.put("personId", relation.getStudentId());
+ PageUtils page = tenRecordService.getByPersonIds(params);
+ return R.ok().put("data", page);
+ }
return R.ok().put("data",new PageUtils(new ArrayList<>(),0,0,0));
}
diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppLoginController.java b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppLoginParentController.java
similarity index 88%
rename from shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppLoginController.java
rename to shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppLoginParentController.java
index 11085d7..3301eb6 100644
--- a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppLoginController.java
+++ b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppLoginParentController.java
@@ -1,17 +1,16 @@
package net.shapelight.modules.appparent.controller;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.shapelight.common.utils.IpUtils;
import net.shapelight.common.utils.R;
import net.shapelight.common.utils.ServletUtils;
import net.shapelight.common.validator.ValidatorUtils;
+import net.shapelight.modules.app.form.LoginForm;
import net.shapelight.modules.appparent.annotation.Login;
import net.shapelight.modules.appparent.annotation.LoginUser;
-import net.shapelight.modules.appparent.form.LoginForm;
-import net.shapelight.modules.appparent.utils.JwtUtils;
+import net.shapelight.modules.appparent.utils.ParentJwtUtils;
import net.shapelight.modules.ten.entity.TenParent;
import net.shapelight.modules.ten.service.TenParentService;
import net.shapelight.modules.vo.TokenVo;
@@ -26,9 +25,9 @@ import java.util.Date;
@RestController
@RequestMapping("/parent/app")
@Api("APP登录接口")
-public class AppLoginController {
+public class AppLoginParentController {
@Autowired
- private JwtUtils jwtUtils;
+ private ParentJwtUtils parentJwtUtils;
// @Autowired
// PushService pushService;
@Autowired
@@ -45,10 +44,10 @@ public class AppLoginController {
//用户登录
TenParent user = parentService.login(form);
//生成token
- String token = jwtUtils.generateToken(user.getUserId());
+ String token = parentJwtUtils.generateToken(user.getId());
TokenVo tokenVo = new TokenVo();
tokenVo.setToken(token);
- tokenVo.setExpire((int)jwtUtils.getExpire());
+ tokenVo.setExpire((int) parentJwtUtils.getExpire());
String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
user.setLoginTime(new Date());
user.setLoginIp(ip);
diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppApiController.java b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppParentApiController.java
similarity index 94%
rename from shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppApiController.java
rename to shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppParentApiController.java
index c0e311d..93e94ec 100644
--- a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppApiController.java
+++ b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppParentApiController.java
@@ -1,9 +1,6 @@
package net.shapelight.modules.appparent.controller;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.minio.MinioClient;
@@ -25,6 +22,7 @@ import net.shapelight.modules.sys.service.SysUserService;
import net.shapelight.modules.ten.entity.*;
import net.shapelight.modules.ten.service.*;
import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient;
+import net.shapelight.modules.vo.SchoolNameVo;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.io.FilenameUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -43,7 +41,7 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("/parent/app")
@Api("APP接口")
-public class AppApiController {
+public class AppParentApiController {
@Autowired
private TenPersonService tenPersonService;
@@ -103,6 +101,12 @@ public class AppApiController {
return R.ok().put("data", list);
}
+ @GetMapping("school")
+ public R getAllCell(@RequestParam String name) {
+ List schoolNameVo = tenCellService.findByName(name);
+ return R.ok().put("data",schoolNameVo);
+ }
+
@PostMapping("checkCellAdmin")
@ApiOperation("验证小区管理员是否正确")
@@ -113,7 +117,7 @@ public class AppApiController {
String adminMobile = (String) params.get("adminMobile");
String cellId = appUserService.checkCellAdmin(adminMobile);
String tenantId = String.valueOf(tenCellService.getById(cellId).getTenantId());
- if (cellId != null && !cellId.isEmpty()) {
+ if (cellId != null && !cellId.isEmpty() ) {
Map cellMap = new HashMap<>();
cellMap.put("cellId", cellId);
cellMap.put("tenantId",tenantId);
@@ -139,15 +143,15 @@ public class AppApiController {
return R.error("手机号已经注册");
}
TenParent tenParent = new TenParent();
- parent.setUserName(tenPerson.getUsername());
- parent.setMobile(tenPerson.getMobile());
+ tenParent.setUserName(tenPerson.getName());
+ tenParent.setMobile(tenPerson.getMobile());
//sha256加密
// String salt = RandomStringUtils.randomAlphanumeric(20);
// appUser.setPassword(new Sha256Hash(entity.getPassword(), salt).toHex());
// appUser.setSalt(salt);
- parent.setPassword(DigestUtils.sha256Hex(tenPerson.getPassword()));
- parent.setCreateTime(new Date());
- parent.setCellId(tenPerson.getCellId());
+ tenParent.setPassword(DigestUtils.sha256Hex(tenPerson.getPassword()));
+ tenParent.setCreateTime(new Date());
+ tenParent.setCellId(tenPerson.getCellId());
tenParent.setName(tenPerson.getName());
tenParent.setGender(tenPerson.getGender());
tenParent.setIdCard(tenPerson.getIdCard());
@@ -319,7 +323,7 @@ public class AppApiController {
// if(tenPersonIdcard!=null){
// return R.error("身份证在此房间已存在");
// }
- List list = tenPersonService.findByIdCardAndDept(tenPerson.getIdCard(),tenPerson.getDeptId());
+ List list = tenPersonService.findByIdCardAndDept(tenPerson.getIdCard(),tenPerson.getDeptId(),tenPerson.getCellId());
if(list.size()>0){
return R.error("身份证在此组织已存在");
}
@@ -370,12 +374,16 @@ public class AppApiController {
if(!relationList.isEmpty()) {
List list = relationList.stream().map(TenRelation::getStudentId).collect(Collectors.toList());
- params.put("cellId",user.getCellId());
+ List personEntityList = new ArrayList<>();
+ relationList.forEach(relation -> {
+ personEntityList.add(tenPersonService.getById(relation.getStudentId(),relation.getCellId()));
+ });
+ /*params.put("cellId",user.getCellId());
params.put("personIds",list.stream().distinct().collect(Collectors.toList()));
- PageUtils page = tenPersonService.selectBypersonIds(params);
- return R.ok().put("data",page);
+ PageUtils page = tenPersonService.selectBypersonIds(params);*/
+ return R.ok().put("data",personEntityList);
}
- return R.ok().put("data",new PageUtils(new ArrayList<>(),0,0,0));
+ return R.ok().put("data",new ArrayList<>());
}
@@ -392,7 +400,7 @@ public class AppApiController {
public R getGuest(@LoginUser TenParent user, @RequestBody Map params) {
String key = (String)params.get("key");
- params.put("cellId", user.getCellId().toString());
+ //params.put("cellId", user.getCellId().toString());
params.put("createBy", user.getId().toString());
PageUtils page = tenPersonService.selectByCreateByQueryPage(params);
return R.ok().put("data", page);
@@ -479,10 +487,11 @@ public class AppApiController {
}
}
TenRelation relation = new TenRelation();
- relation.setParentId(user.getUserId());
+ relation.setParentId(user.getId());
relation.setStudentId(entity.getPersonId());
relation.setCreateTime(new Date());
relation.setStatus(2);
+ relation.setCellId(entity.getCellId());
relation.setRelation(params.get("salutation").toString());
relationService.save(relation);
return R.ok();
diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppRegisterController.java b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppRegisterParentController.java
similarity index 98%
rename from shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppRegisterController.java
rename to shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppRegisterParentController.java
index 459dbb8..6a7f11a 100644
--- a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppRegisterController.java
+++ b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppRegisterParentController.java
@@ -9,9 +9,9 @@ import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import net.shapelight.common.utils.R;
import net.shapelight.common.utils.RedisUtils;
+import net.shapelight.modules.app.utils.MonyunSmsUtils;
import net.shapelight.modules.appparent.annotation.Login;
import net.shapelight.modules.appparent.annotation.LoginUser;
-import net.shapelight.modules.appparent.utils.MonyunSmsUtils;
import net.shapelight.modules.ten.entity.TenParent;
import net.shapelight.modules.ten.service.TenParentService;
import org.apache.commons.codec.digest.DigestUtils;
@@ -22,7 +22,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
@@ -33,7 +32,7 @@ import java.util.Random;
@RestController
@RequestMapping("/parent/app")
@Api("APP注册接口")
-public class AppRegisterController {
+public class AppRegisterParentController {
@Autowired
private RedisUtils redisUtils;
@Autowired
@@ -49,6 +48,7 @@ public class AppRegisterController {
public R sendsms(@RequestBody Map params) {
//验证手机是否注册
String mobile = (String) params.get("mobile");
+ Long cellId = (Long) params.get("cellId");
int type = (Integer) params.get("type");
//type=1 //注册
//type=2 //忘记密码
@@ -152,6 +152,7 @@ public class AppRegisterController {
public R forgetPassword(HttpServletRequest request, @RequestBody Map map) {
String mobile = (String) map.get("mobile");
String password = (String) map.get("password");
+ Long cellId = (Long) map.get("cellId");
// String smscode = (String) map.get("smscode");
// JSONObject SessionJson = (JSONObject) request.getSession().getAttribute("verifyCode");
diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/form/LoginForm.java b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/form/LoginForm.java
deleted file mode 100644
index 100e115..0000000
--- a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/form/LoginForm.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Copyright 2018 http://www.gfirefly.com
- *
- * 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
- *
- * 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 net.shapelight.modules.appparent.form;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-
-/**
- * 登录表单
- *
- */
-@ApiModel(value = "登录表单")
-@Data
-public class LoginForm {
- @ApiModelProperty(value = "手机号")
- @NotBlank(message="手机号不能为空")
- private String mobile;
-
- @ApiModelProperty(value = "密码")
- @NotBlank(message="密码不能为空")
- private String password;
-
-// @ApiModelProperty(value = "推送ID")
-// private String registrationId;
-
-}
diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/form/RegisterForm.java b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/form/RegisterForm.java
deleted file mode 100644
index cc5a14d..0000000
--- a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/form/RegisterForm.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Copyright 2018 http://www.gfirefly.com
- *
- * 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
- *
- * 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 net.shapelight.modules.appparent.form;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-
-/**
- * 注册表单
- *
- */
-@Data
-@ApiModel(value = "注册表单")
-public class RegisterForm {
- @ApiModelProperty(value = "手机号")
- @NotBlank(message="手机号不能为空")
- private String mobile;
-
- @ApiModelProperty(value = "密码")
- @NotBlank(message="密码不能为空")
- private String password;
-
-}
diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/form/RegisterSmsForm.java b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/form/RegisterSmsForm.java
deleted file mode 100644
index 245668a..0000000
--- a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/form/RegisterSmsForm.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Copyright 2018 http://www.gfirefly.com
- *
- * 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
- *