diff --git a/miaosha-admin/miaosha-admin-api/pom.xml b/miaosha-admin/miaosha-admin-api/pom.xml index 2505e38..df189dd 100644 --- a/miaosha-admin/miaosha-admin-api/pom.xml +++ b/miaosha-admin/miaosha-admin-api/pom.xml @@ -7,4 +7,21 @@ 0.0.1-SNAPSHOT miaosha-admin-api + + + + + org.projectlombok + lombok + 1.18.2 + provided + + + + com.geekq + miaosha-common + 0.0.1-SNAPSHOT + + + \ No newline at end of file diff --git a/miaosha-admin/miaosha-admin-api/src/main/java/com/geekq/order/service/MiaoShaUserService.java b/miaosha-admin/miaosha-admin-api/src/main/java/com/geekq/order/service/MiaoShaUserService.java new file mode 100644 index 0000000..8d98260 --- /dev/null +++ b/miaosha-admin/miaosha-admin-api/src/main/java/com/geekq/order/service/MiaoShaUserService.java @@ -0,0 +1,48 @@ +package com.geekq.order.service; + +import com.geekq.common.entity.MiaoshaUser; + +import java.util.List; +import java.util.Map; + +public interface MiaoShaUserService { + + /** + * 注册 + * @param username + * @param password + */ + void register(String username, String password); + + /** + * 检查是否有重复的用户名 + */ + boolean checkUsername(String name, int userType); + + /** + * 用户登陆 + * @param name + * @param password + * @return + */ + MiaoshaUser login(String name, String password, int userType, String ip); + + /** + * 是否有管理员 + * @return + */ + boolean hasAdmin(); + + /** + * 创建默认的管理员 + */ + void createDefaultAdmin(); + + /** + * 查询用户的id和name + * @param word + * @param userType + * @return + */ + List> autoComplate(String word, int userType); +} diff --git a/miaosha-admin/miaosha-admin-web/src/main/java/com/geekq/web/controller/RegisterController.java b/miaosha-admin/miaosha-admin-web/src/main/java/com/geekq/web/controller/RegisterController.java new file mode 100644 index 0000000..6375d82 --- /dev/null +++ b/miaosha-admin/miaosha-admin-web/src/main/java/com/geekq/web/controller/RegisterController.java @@ -0,0 +1,31 @@ +package com.geekq.web.controller; + +import com.geekq.common.utils.resultbean.ResultGeekQ; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +@Controller +public class RegisterController extends BaseController{ + + + @RequestMapping("/register") + @ResponseBody + public ResultGeekQ register(String username, String password) { + ResultGeekQ result = ResultGeekQ.build(); + try { + } catch (RuntimeException e) { + } + return result; + } + + @RequestMapping("/checkUsername") + @ResponseBody + public ResultGeekQ checkUsername(String username) { + ResultGeekQ result = ResultGeekQ.build(); + try { + } catch (RuntimeException e) { + } + return result; + } +} diff --git a/miaosha-admin/miaosha-admin-web/src/main/webapp/register.html b/miaosha-admin/miaosha-admin-web/src/main/webapp/register.html index 288f36c..1dc2ef2 100644 --- a/miaosha-admin/miaosha-admin-web/src/main/webapp/register.html +++ b/miaosha-admin/miaosha-admin-web/src/main/webapp/register.html @@ -2,7 +2,7 @@ -蓝源Eloan-P2P平台->用户注册 +秒杀平台->用户注册 @@ -171,22 +171,15 @@
-

专注于高级Java开发工程师的培养

-

版权所有: 2015广州小码哥教育科技有限公司

-

地  址: 广州市天河区棠下荷光三横路盛达商务园D座5楼

-

电  话: 020-29007520   - 邮箱: service@520it.com

-

- ICP备案 - :粤ICP备字1504547 -

-

- 穗公网安备:44010650010086 -

+

we -- hello -- world

+

版权所有: GeekQ

+

地  址: 北京市

+

Q  Q: 3341386488  

+

邮 箱: QiuRunZe_key@163.com

- +
diff --git a/miaosha-admin/miaosha-common/src/main/java/com/geekq/common/entity/MiaoshaUser.java b/miaosha-admin/miaosha-common/src/main/java/com/geekq/common/entity/MiaoshaUser.java new file mode 100644 index 0000000..7b25380 --- /dev/null +++ b/miaosha-admin/miaosha-common/src/main/java/com/geekq/common/entity/MiaoshaUser.java @@ -0,0 +1,26 @@ +package com.geekq.common.entity; + +import com.geekq.common.enums.Constants; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.Date; + +@Setter +@Getter +@AllArgsConstructor +@NoArgsConstructor +public class MiaoshaUser { + + private Long id; + private String nickname; + private String password; + private String salt; + private Date registerDate; + private Date lastLoginDate; + private int state = Constants.STATE_NORMAL; + private int userType;//用户类型 + private boolean admin = false; +} diff --git a/miaosha-admin/miaosha-common/src/main/java/com/geekq/common/enums/Constants.java b/miaosha-admin/miaosha-common/src/main/java/com/geekq/common/enums/Constants.java new file mode 100644 index 0000000..edd44d5 --- /dev/null +++ b/miaosha-admin/miaosha-common/src/main/java/com/geekq/common/enums/Constants.java @@ -0,0 +1,15 @@ +package com.geekq.common.enums; + +/** + * @author 邱润泽 + * 常用数据静态变量类型集合 + */ +public class Constants { + + public static final int STATE_NORMAL = 0; + public static final int STATE_LOCK = 1; + public static final int STATE_DELETE = -1; + + public static final int USERTYPE_NORMAL = 0;//前段用户 + public static final int USERTYPE_SYSTEM = 1;//后台用户 +} diff --git a/miaosha-admin/miaosha-common/src/main/java/com/geekq/common/pojo/JqGridResult.java b/miaosha-admin/miaosha-common/src/main/java/com/geekq/common/pojo/JqGridResult.java deleted file mode 100644 index 7a3df20..0000000 --- a/miaosha-admin/miaosha-common/src/main/java/com/geekq/common/pojo/JqGridResult.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.geekq.common.pojo; - -import java.util.List; - -/** - * - * @Description: 用来返回jqGrid的数据格式 - */ -public class JqGridResult { - - private int page; // 当前页数 - private int total; // 总页数 - private long records; // 总记录数 - private List rows; // 每行显示的内容 - private Object userdata; // 用户自定义数据 - - public int getPage() { - return page; - } - public void setPage(int page) { - this.page = page; - } - public int getTotal() { - return total; - } - public void setTotal(int total) { - this.total = total; - } - public long getRecords() { - return records; - } - public void setRecords(long records) { - this.records = records; - } - public List getRows() { - return rows; - } - public void setRows(List rows) { - this.rows = rows; - } - public Object getUserdata() { - return userdata; - } - public void setUserdata(Object userdata) { - this.userdata = userdata; - } - -}