diff --git a/src/dianping/src/main/resources/ddl.sql b/src/dianping/src/main/resources/ddl.sql deleted file mode 100644 index 4afb008a..00000000 --- a/src/dianping/src/main/resources/ddl.sql +++ /dev/null @@ -1,11 +0,0 @@ -CREATE TABLE `dianpingdb`.`user` ( - `id` int NOT NULL AUTO_INCREMENT, - `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `telephone` varchar(40) NOT NULL DEFAULT '', - `password` varchar(200) NOT NULL DEFAULT '', - `nick_name` varchar(40) NOT NULL DEFAULT '', - `gender` int NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - UNIQUE INDEX `telephone_unique_index`(`telephone`) USING BTREE -); \ No newline at end of file diff --git a/src/dianping/.gitignore b/src/recommend/.gitignore similarity index 100% rename from src/dianping/.gitignore rename to src/recommend/.gitignore diff --git a/src/dianping/.mvn/wrapper/maven-wrapper.jar b/src/recommend/.mvn/wrapper/maven-wrapper.jar similarity index 100% rename from src/dianping/.mvn/wrapper/maven-wrapper.jar rename to src/recommend/.mvn/wrapper/maven-wrapper.jar diff --git a/src/dianping/.mvn/wrapper/maven-wrapper.properties b/src/recommend/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from src/dianping/.mvn/wrapper/maven-wrapper.properties rename to src/recommend/.mvn/wrapper/maven-wrapper.properties diff --git a/src/dianping/mvnw b/src/recommend/mvnw similarity index 100% rename from src/dianping/mvnw rename to src/recommend/mvnw diff --git a/src/dianping/mvnw.cmd b/src/recommend/mvnw.cmd similarity index 100% rename from src/dianping/mvnw.cmd rename to src/recommend/mvnw.cmd diff --git a/src/dianping/pom.xml b/src/recommend/pom.xml similarity index 96% rename from src/dianping/pom.xml rename to src/recommend/pom.xml index 540d4f3a..3744ea73 100644 --- a/src/dianping/pom.xml +++ b/src/recommend/pom.xml @@ -8,11 +8,11 @@ 2.7.16 - com.imooc - dianping + com.example + recommend 0.0.1-SNAPSHOT - dianping - dianping + recommend + recommend 1.8 UTF-8 @@ -73,7 +73,7 @@ - + org.mybatis.generator diff --git a/src/dianping/src/main/java/com/imooc/dianping/DianpingApplication.java b/src/recommend/src/main/java/com/example/recommend/RecommendApplication.java similarity index 58% rename from src/dianping/src/main/java/com/imooc/dianping/DianpingApplication.java rename to src/recommend/src/main/java/com/example/recommend/RecommendApplication.java index 48036de0..50415e72 100644 --- a/src/dianping/src/main/java/com/imooc/dianping/DianpingApplication.java +++ b/src/recommend/src/main/java/com/example/recommend/RecommendApplication.java @@ -1,17 +1,17 @@ -package com.imooc.dianping; +package com.example.recommend; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.EnableAspectJAutoProxy; -@SpringBootApplication(scanBasePackages = {"com.imooc.dianping"}) -@MapperScan("com.imooc.dianping.dal") +@SpringBootApplication(scanBasePackages = {"com.example.recommend"}) +@MapperScan("com.example.recommend.dal") @EnableAspectJAutoProxy(proxyTargetClass = true) -public class DianpingApplication { +public class RecommendApplication { public static void main(String[] args) { - SpringApplication.run(DianpingApplication.class, args); + SpringApplication.run(RecommendApplication.class, args); } } diff --git a/src/dianping/src/main/java/com/imooc/dianping/common/BusinessException.java b/src/recommend/src/main/java/com/example/recommend/common/BusinessException.java similarity index 94% rename from src/dianping/src/main/java/com/imooc/dianping/common/BusinessException.java rename to src/recommend/src/main/java/com/example/recommend/common/BusinessException.java index 60a4448a..e6d5258f 100644 --- a/src/dianping/src/main/java/com/imooc/dianping/common/BusinessException.java +++ b/src/recommend/src/main/java/com/example/recommend/common/BusinessException.java @@ -1,4 +1,4 @@ -package com.imooc.dianping.common; +package com.example.recommend.common; public class BusinessException extends Exception { private CommonError commonError; diff --git a/src/dianping/src/main/java/com/imooc/dianping/common/CommonError.java b/src/recommend/src/main/java/com/example/recommend/common/CommonError.java similarity index 94% rename from src/dianping/src/main/java/com/imooc/dianping/common/CommonError.java rename to src/recommend/src/main/java/com/example/recommend/common/CommonError.java index 9eee2fbf..aa0c85de 100644 --- a/src/dianping/src/main/java/com/imooc/dianping/common/CommonError.java +++ b/src/recommend/src/main/java/com/example/recommend/common/CommonError.java @@ -1,4 +1,4 @@ -package com.imooc.dianping.common; +package com.example.recommend.common; public class CommonError { //错误码 diff --git a/src/dianping/src/main/java/com/imooc/dianping/common/CommonRes.java b/src/recommend/src/main/java/com/example/recommend/common/CommonRes.java similarity index 96% rename from src/dianping/src/main/java/com/imooc/dianping/common/CommonRes.java rename to src/recommend/src/main/java/com/example/recommend/common/CommonRes.java index e17af76d..f8041a04 100644 --- a/src/dianping/src/main/java/com/imooc/dianping/common/CommonRes.java +++ b/src/recommend/src/main/java/com/example/recommend/common/CommonRes.java @@ -1,4 +1,4 @@ -package com.imooc.dianping.common; +package com.example.recommend.common; public class CommonRes { //表明读经请求的返回处理结果,"success"或"fail" diff --git a/src/dianping/src/main/java/com/imooc/dianping/common/CommonUtil.java b/src/recommend/src/main/java/com/example/recommend/common/CommonUtil.java similarity index 93% rename from src/dianping/src/main/java/com/imooc/dianping/common/CommonUtil.java rename to src/recommend/src/main/java/com/example/recommend/common/CommonUtil.java index a5b2be04..47ff1eb5 100644 --- a/src/dianping/src/main/java/com/imooc/dianping/common/CommonUtil.java +++ b/src/recommend/src/main/java/com/example/recommend/common/CommonUtil.java @@ -1,4 +1,4 @@ -package com.imooc.dianping.common; +package com.example.recommend.common; import org.springframework.validation.BindingResult; import org.springframework.validation.FieldError; diff --git a/src/dianping/src/main/java/com/imooc/dianping/common/EmBusinessError.java b/src/recommend/src/main/java/com/example/recommend/common/EmBusinessError.java similarity index 96% rename from src/dianping/src/main/java/com/imooc/dianping/common/EmBusinessError.java rename to src/recommend/src/main/java/com/example/recommend/common/EmBusinessError.java index 365dd292..d30e76c7 100644 --- a/src/dianping/src/main/java/com/imooc/dianping/common/EmBusinessError.java +++ b/src/recommend/src/main/java/com/example/recommend/common/EmBusinessError.java @@ -1,4 +1,4 @@ -package com.imooc.dianping.common; +package com.example.recommend.common; public enum EmBusinessError { //通用的错误类型10000开头 diff --git a/src/dianping/src/main/java/com/imooc/dianping/common/GlobalExceptionHandler.java b/src/recommend/src/main/java/com/example/recommend/common/GlobalExceptionHandler.java similarity index 97% rename from src/dianping/src/main/java/com/imooc/dianping/common/GlobalExceptionHandler.java rename to src/recommend/src/main/java/com/example/recommend/common/GlobalExceptionHandler.java index 8daf0b94..5b4e30d8 100644 --- a/src/dianping/src/main/java/com/imooc/dianping/common/GlobalExceptionHandler.java +++ b/src/recommend/src/main/java/com/example/recommend/common/GlobalExceptionHandler.java @@ -1,4 +1,4 @@ -package com.imooc.dianping.common; +package com.example.recommend.common; import org.springframework.web.bind.ServletRequestBindingException; import org.springframework.web.bind.annotation.ControllerAdvice; diff --git a/src/dianping/src/main/java/com/imooc/dianping/controller/UserController.java b/src/recommend/src/main/java/com/example/recommend/controller/UserController.java similarity index 85% rename from src/dianping/src/main/java/com/imooc/dianping/controller/UserController.java rename to src/recommend/src/main/java/com/example/recommend/controller/UserController.java index 0fb874ce..4e59708f 100644 --- a/src/dianping/src/main/java/com/imooc/dianping/controller/UserController.java +++ b/src/recommend/src/main/java/com/example/recommend/controller/UserController.java @@ -1,12 +1,12 @@ -package com.imooc.dianping.controller; +package com.example.recommend.controller; -import com.imooc.dianping.common.BusinessException; -import com.imooc.dianping.common.CommonRes; -import com.imooc.dianping.common.CommonUtil; -import com.imooc.dianping.common.EmBusinessError; -import com.imooc.dianping.model.UserModel; -import com.imooc.dianping.request.RegisterReq; -import com.imooc.dianping.service.UserService; +import com.example.recommend.common.BusinessException; +import com.example.recommend.common.CommonRes; +import com.example.recommend.common.CommonUtil; +import com.example.recommend.common.EmBusinessError; +import com.example.recommend.request.RegisterReq; +import com.example.recommend.service.UserService; +import com.example.recommend.model.UserModel; import jakarta.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; diff --git a/src/dianping/src/main/java/com/imooc/dianping/dal/UserModelMapper.java b/src/recommend/src/main/java/com/example/recommend/dal/UserModelMapper.java similarity index 74% rename from src/dianping/src/main/java/com/imooc/dianping/dal/UserModelMapper.java rename to src/recommend/src/main/java/com/example/recommend/dal/UserModelMapper.java index 5e2ee67f..40e1dc76 100644 --- a/src/dianping/src/main/java/com/imooc/dianping/dal/UserModelMapper.java +++ b/src/recommend/src/main/java/com/example/recommend/dal/UserModelMapper.java @@ -1,13 +1,13 @@ -package com.imooc.dianping.dal; +package com.example.recommend.dal; -import com.imooc.dianping.model.UserModel; +import com.example.recommend.model.UserModel; public interface UserModelMapper { /** * This method was generated by MyBatis Generator. * This method corresponds to the database table user * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ int deleteByPrimaryKey(Integer id); @@ -15,7 +15,7 @@ public interface UserModelMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table user * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ int insert(UserModel record); @@ -23,7 +23,7 @@ public interface UserModelMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table user * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ int insertSelective(UserModel record); @@ -31,7 +31,7 @@ public interface UserModelMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table user * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ UserModel selectByPrimaryKey(Integer id); @@ -39,7 +39,7 @@ public interface UserModelMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table user * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ int updateByPrimaryKeySelective(UserModel record); @@ -47,7 +47,7 @@ public interface UserModelMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table user * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ int updateByPrimaryKey(UserModel record); } \ No newline at end of file diff --git a/src/dianping/src/main/java/com/imooc/dianping/model/UserModel.java b/src/recommend/src/main/java/com/example/recommend/model/UserModel.java similarity index 82% rename from src/dianping/src/main/java/com/imooc/dianping/model/UserModel.java rename to src/recommend/src/main/java/com/example/recommend/model/UserModel.java index 2be37bba..dbc35076 100644 --- a/src/dianping/src/main/java/com/imooc/dianping/model/UserModel.java +++ b/src/recommend/src/main/java/com/example/recommend/model/UserModel.java @@ -1,4 +1,4 @@ -package com.imooc.dianping.model; +package com.example.recommend.model; import java.util.Date; @@ -8,7 +8,7 @@ public class UserModel { * This field was generated by MyBatis Generator. * This field corresponds to the database column user.id * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ private Integer id; @@ -17,7 +17,7 @@ public class UserModel { * This field was generated by MyBatis Generator. * This field corresponds to the database column user.created_at * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ private Date createdAt; @@ -26,7 +26,7 @@ public class UserModel { * This field was generated by MyBatis Generator. * This field corresponds to the database column user.updated_at * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ private Date updatedAt; @@ -35,7 +35,7 @@ public class UserModel { * This field was generated by MyBatis Generator. * This field corresponds to the database column user.telephone * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ private String telephone; @@ -44,7 +44,7 @@ public class UserModel { * This field was generated by MyBatis Generator. * This field corresponds to the database column user.password * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ private String password; @@ -53,7 +53,7 @@ public class UserModel { * This field was generated by MyBatis Generator. * This field corresponds to the database column user.nick_name * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ private String nickName; @@ -62,7 +62,7 @@ public class UserModel { * This field was generated by MyBatis Generator. * This field corresponds to the database column user.gender * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ private Integer gender; @@ -72,7 +72,7 @@ public class UserModel { * * @return the value of user.id * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ public Integer getId() { return id; @@ -84,7 +84,7 @@ public class UserModel { * * @param id the value for user.id * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ public void setId(Integer id) { this.id = id; @@ -96,7 +96,7 @@ public class UserModel { * * @return the value of user.created_at * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ public Date getCreatedAt() { return createdAt; @@ -108,7 +108,7 @@ public class UserModel { * * @param createdAt the value for user.created_at * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; @@ -120,7 +120,7 @@ public class UserModel { * * @return the value of user.updated_at * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ public Date getUpdatedAt() { return updatedAt; @@ -132,7 +132,7 @@ public class UserModel { * * @param updatedAt the value for user.updated_at * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ public void setUpdatedAt(Date updatedAt) { this.updatedAt = updatedAt; @@ -144,7 +144,7 @@ public class UserModel { * * @return the value of user.telephone * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ public String getTelephone() { return telephone; @@ -156,7 +156,7 @@ public class UserModel { * * @param telephone the value for user.telephone * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ public void setTelephone(String telephone) { this.telephone = telephone == null ? null : telephone.trim(); @@ -168,7 +168,7 @@ public class UserModel { * * @return the value of user.password * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ public String getPassword() { return password; @@ -180,7 +180,7 @@ public class UserModel { * * @param password the value for user.password * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ public void setPassword(String password) { this.password = password == null ? null : password.trim(); @@ -192,7 +192,7 @@ public class UserModel { * * @return the value of user.nick_name * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ public String getNickName() { return nickName; @@ -204,7 +204,7 @@ public class UserModel { * * @param nickName the value for user.nick_name * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ public void setNickName(String nickName) { this.nickName = nickName == null ? null : nickName.trim(); @@ -216,7 +216,7 @@ public class UserModel { * * @return the value of user.gender * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ public Integer getGender() { return gender; @@ -228,7 +228,7 @@ public class UserModel { * * @param gender the value for user.gender * - * @mbg.generated Fri Oct 06 13:41:12 CST 2023 + * @mbg.generated Mon Oct 09 13:50:54 CST 2023 */ public void setGender(Integer gender) { this.gender = gender; diff --git a/src/dianping/src/main/java/com/imooc/dianping/request/RegisterReq.java b/src/recommend/src/main/java/com/example/recommend/request/RegisterReq.java similarity index 96% rename from src/dianping/src/main/java/com/imooc/dianping/request/RegisterReq.java rename to src/recommend/src/main/java/com/example/recommend/request/RegisterReq.java index f11641fc..3f620e48 100644 --- a/src/dianping/src/main/java/com/imooc/dianping/request/RegisterReq.java +++ b/src/recommend/src/main/java/com/example/recommend/request/RegisterReq.java @@ -1,4 +1,4 @@ -package com.imooc.dianping.request; +package com.example.recommend.request; import jakarta.validation.constraints.NotBlank; diff --git a/src/dianping/src/main/java/com/imooc/dianping/service/UserService.java b/src/recommend/src/main/java/com/example/recommend/service/UserService.java similarity index 53% rename from src/dianping/src/main/java/com/imooc/dianping/service/UserService.java rename to src/recommend/src/main/java/com/example/recommend/service/UserService.java index 5659520a..9842969a 100644 --- a/src/dianping/src/main/java/com/imooc/dianping/service/UserService.java +++ b/src/recommend/src/main/java/com/example/recommend/service/UserService.java @@ -1,7 +1,7 @@ -package com.imooc.dianping.service; +package com.example.recommend.service; -import com.imooc.dianping.common.BusinessException; -import com.imooc.dianping.model.UserModel; +import com.example.recommend.common.BusinessException; +import com.example.recommend.model.UserModel; import java.io.UnsupportedEncodingException; import java.security.NoSuchAlgorithmException; @@ -11,7 +11,7 @@ public interface UserService { UserModel register(UserModel registerUser) throws BusinessException, UnsupportedEncodingException, NoSuchAlgorithmException; - UserModel login(String telphone, String password) throws UnsupportedEncodingException, NoSuchAlgorithmException, BusinessException; + UserModel login(String telephone, String password) throws UnsupportedEncodingException, NoSuchAlgorithmException, BusinessException; Integer countAllUser(); } diff --git a/src/dianping/src/main/java/com/imooc/dianping/service/impl/UserServiceImpl.java b/src/recommend/src/main/java/com/example/recommend/service/impl/UserServiceImpl.java similarity index 79% rename from src/dianping/src/main/java/com/imooc/dianping/service/impl/UserServiceImpl.java rename to src/recommend/src/main/java/com/example/recommend/service/impl/UserServiceImpl.java index b86e0b21..8e4c5565 100644 --- a/src/dianping/src/main/java/com/imooc/dianping/service/impl/UserServiceImpl.java +++ b/src/recommend/src/main/java/com/example/recommend/service/impl/UserServiceImpl.java @@ -1,10 +1,10 @@ -package com.imooc.dianping.service.impl; +package com.example.recommend.service.impl; -import com.imooc.dianping.common.BusinessException; -import com.imooc.dianping.common.EmBusinessError; -import com.imooc.dianping.dal.UserModelMapper; -import com.imooc.dianping.model.UserModel; -import com.imooc.dianping.service.UserService; +import com.example.recommend.common.BusinessException; +import com.example.recommend.common.EmBusinessError; +import com.example.recommend.dal.UserModelMapper; +import com.example.recommend.model.UserModel; +import com.example.recommend.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DuplicateKeyException; import org.springframework.stereotype.Service; @@ -43,7 +43,7 @@ public class UserServiceImpl implements UserService { } @Override - public UserModel login(String telphone, String password) throws UnsupportedEncodingException, NoSuchAlgorithmException, BusinessException { + public UserModel login(String telephone, String password) throws UnsupportedEncodingException, NoSuchAlgorithmException, BusinessException { return null; } diff --git a/src/dianping/src/main/resources/application.properties b/src/recommend/src/main/resources/application.properties similarity index 75% rename from src/dianping/src/main/resources/application.properties rename to src/recommend/src/main/resources/application.properties index b6a52365..2fc52cef 100644 --- a/src/dianping/src/main/resources/application.properties +++ b/src/recommend/src/main/resources/application.properties @@ -1,8 +1,8 @@ server.port=8010 mybatis.mapperLocations=classpath:mapping/*.xml #??????????? -spring.datasource.name=dianpingdb -spring.datasource.url=jdbc:mysql://127.0.0.1:3306/dianpingdb?useUnicode=true&characterEncoding=UTF-8&useSSL=false +spring.datasource.name=recommenddb +spring.datasource.url=jdbc:mysql://127.0.0.1:3306/recommenddb?useUnicode=true&characterEncoding=UTF-8&useSSL=false spring.datasource.username=root spring.datasource.password=123456 #??druid?????? diff --git a/src/recommend/src/main/resources/ddl.sql b/src/recommend/src/main/resources/ddl.sql new file mode 100644 index 00000000..4e4fc6b7 --- /dev/null +++ b/src/recommend/src/main/resources/ddl.sql @@ -0,0 +1,12 @@ +CREATE TABLE `recommenddb`.`user` +( + `id` int NOT NULL AUTO_INCREMENT, + `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `telephone` varchar(40) NOT NULL DEFAULT '', + `password` varchar(200) NOT NULL DEFAULT '', + `nick_name` varchar(40) NOT NULL DEFAULT '', + `gender` int NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + UNIQUE INDEX `telephone_unique_index` (`telephone`) USING BTREE +); \ No newline at end of file diff --git a/src/dianping/src/main/resources/mapping/UserModelMapper.xml b/src/recommend/src/main/resources/mapping/UserModelMapper.xml similarity index 82% rename from src/dianping/src/main/resources/mapping/UserModelMapper.xml rename to src/recommend/src/main/resources/mapping/UserModelMapper.xml index 961174f6..55118d7f 100644 --- a/src/dianping/src/main/resources/mapping/UserModelMapper.xml +++ b/src/recommend/src/main/resources/mapping/UserModelMapper.xml @@ -1,11 +1,11 @@ - - + + @@ -19,7 +19,7 @@ id, created_at, updated_at, telephone, password, nick_name, gender @@ -27,7 +27,7 @@ select @@ -38,16 +38,16 @@ delete from user where id = #{id,jdbcType=INTEGER} - + SELECT LAST_INSERT_ID() @@ -59,11 +59,11 @@ #{password,jdbcType=VARCHAR}, #{nickName,jdbcType=VARCHAR}, #{gender,jdbcType=INTEGER} ) - + SELECT LAST_INSERT_ID() @@ -110,11 +110,11 @@ - + update user @@ -139,11 +139,11 @@ where id = #{id,jdbcType=INTEGER} - + update user set created_at = #{createdAt,jdbcType=TIMESTAMP}, diff --git a/src/dianping/src/main/resources/mybatis-generator.xml b/src/recommend/src/main/resources/mybatis-generator.xml similarity index 78% rename from src/dianping/src/main/resources/mybatis-generator.xml rename to src/recommend/src/main/resources/mybatis-generator.xml index 843db13b..32b90ac9 100644 --- a/src/dianping/src/main/resources/mybatis-generator.xml +++ b/src/recommend/src/main/resources/mybatis-generator.xml @@ -4,12 +4,14 @@ "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> - + - + - + @@ -23,7 +25,7 @@ type="MIXEDMAPPER",生成基于注解的Java Model 和相应的Mapper对象 type="XMLMAPPER",生成SQLMap XML文件和独立的Mapper接口 --> - + @@ -36,10 +38,10 @@ enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"> --> - - +
diff --git a/src/dianping/src/main/resources/static/index.html b/src/recommend/src/main/resources/static/index.html similarity index 100% rename from src/dianping/src/main/resources/static/index.html rename to src/recommend/src/main/resources/static/index.html diff --git a/src/dianping/src/main/resources/static/test.html b/src/recommend/src/main/resources/static/test.html similarity index 100% rename from src/dianping/src/main/resources/static/test.html rename to src/recommend/src/main/resources/static/test.html diff --git a/src/dianping/src/main/resources/templates/index.html b/src/recommend/src/main/resources/templates/index.html similarity index 100% rename from src/dianping/src/main/resources/templates/index.html rename to src/recommend/src/main/resources/templates/index.html diff --git a/src/dianping/src/test/java/com/imooc/dianping/DianpingApplicationTests.java b/src/recommend/src/test/java/com/example/recommend/RecommendApplicationTests.java similarity index 52% rename from src/dianping/src/test/java/com/imooc/dianping/DianpingApplicationTests.java rename to src/recommend/src/test/java/com/example/recommend/RecommendApplicationTests.java index 8f3420dc..72f29eb2 100644 --- a/src/dianping/src/test/java/com/imooc/dianping/DianpingApplicationTests.java +++ b/src/recommend/src/test/java/com/example/recommend/RecommendApplicationTests.java @@ -1,13 +1,13 @@ -package com.imooc.dianping; +package com.example.recommend; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest -class DianpingApplicationTests { +class RecommendApplicationTests { - @Test - void contextLoads() { - } + @Test + void contextLoads() { + } }