Skip to content

Commit

Permalink
项目架构优化、代码编码规范
Browse files Browse the repository at this point in the history
  • Loading branch information
李鹏军 committed Oct 16, 2023
1 parent 1fbdbcd commit 2b0e1ef
Show file tree
Hide file tree
Showing 74 changed files with 469 additions and 602 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Entity里提示报错不是缺少get、set方法,Eclipse、IDEA请先安装`lo
## 重要信息
1. 项目合作洽谈,请联系客服微信(使用微信扫码添加好友,请注明来意)。
2. 如需购买 [商业版源码](https://fly2you.cn/ma.html) 请联系客服。<br>
![](https://platform-wxmall.oss-cn-beijing.aliyuncs.com/image/2023_09_20/UNKNOWN_11_33_59.png "微信")
![](https://platform-wxmall.oss-cn-beijing.aliyuncs.com/image/2023_09_20/11_33_59.png "微信")
3. 微信扫码并关注公众号回复“文档”,获取《微同开源商城启动部署手册.docx》<br>
![](https://platform-wxmall.oss-cn-beijing.aliyuncs.com/upload/20180708/qr.jpg "微信公众号")

Expand All @@ -62,13 +62,11 @@ Entity里提示报错不是缺少get、set方法,Eclipse、IDEA请先安装`lo
## 项目结构
~~~
platform
|--platform-admin 后台管理
|--platform-admin 后台管理(打包发布此项目)
|--platform-api 微信小程序商城api接口
|--platform-common 公共模块
|--platform-framework 打包发布此项目
|--platform-gen 代码生成
|--platform-schedule 定时任务
|--platform-shop 商城后台管理
|--uni-mall uniapp版商城
|--wx-mall 微信小程序原生商城
~~~
Expand Down
26 changes: 25 additions & 1 deletion platform-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,26 @@
<description>管理后台</description>

<dependencies>
<dependency>
<groupId>com.platform</groupId>
<artifactId>platform-api</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.platform</groupId>
<artifactId>platform-common</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.platform</groupId>
<artifactId>platform-gen</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.platform</groupId>
<artifactId>platform-schedule</artifactId>
<version>1.0.0</version>
</dependency>
<!--验证码生成工具-->
<dependency>
<groupId>com.github.penggle</groupId>
Expand Down Expand Up @@ -45,6 +60,7 @@
</profiles>

<build>
<finalName>platform-framework</finalName>
<scriptSourceDirectory>src/main/java</scriptSourceDirectory>
<resources>
<resource>
Expand All @@ -68,6 +84,14 @@
</resource>
</resources>
<plugins>
<!-- maven 打包时跳过测试 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
Expand Down Expand Up @@ -105,4 +129,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,8 @@ public R getAreaTree() {
public R getAreaByType(@RequestParam(required = false) Integer type) {

List<SysRegionEntity> list = new ArrayList<>();
if (type.equals(0)) {

} else if (type.equals(1)) {//省份
if (type.equals(1)) {
//省份
list = RegionCacheUtil.getAllCountry();
} else if (type.equals(2)) {
list = RegionCacheUtil.getAllProvice();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.platform.service.SysUserService;
import com.platform.service.TestSysUserService;
import org.junit.Test;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashMap;
Expand All @@ -24,14 +23,13 @@ public class TestSysUserController extends BaseSpringTestCase {
TestSysUserService testSysUserService;
@Autowired
SysUserService sysUserService;
private Logger logger = getLogger();

/**
* 使用测试类
*/
@Test
public void queryTestSysUserList() {
Map params = new HashMap();
Map<String, Object> params = new HashMap<>();
List<SysUserEntity> list = testSysUserService.queryList(params);
if (list != null && list.size() != 0) {
for (SysUserEntity userEntity : list) {
Expand All @@ -45,7 +43,7 @@ public void queryTestSysUserList() {
*/
@Test
public void querySysUserList() {
Map params = new HashMap();
Map<String, Object> params = new HashMap<>();
List<SysUserEntity> list = sysUserService.queryList(params);
if (list != null && list.size() != 0) {
for (SysUserEntity userEntity : list) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@
import com.platform.utils.CharUtil;
import com.platform.utils.R;
import com.platform.utils.ResourceUtil;
import com.platform.validator.Assert;
import com.platform.validator.AbstractAssert;
import com.qiniu.util.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException;
import org.apache.commons.collections.MapUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

Expand All @@ -50,7 +49,6 @@
@RestController
@RequestMapping("/api/auth")
public class ApiAuthController extends ApiBaseAction {
private Logger logger = Logger.getLogger(getClass());
@Autowired
private ApiUserService userService;
@Autowired
Expand All @@ -65,8 +63,8 @@ public class ApiAuthController extends ApiBaseAction {
@PostMapping("login")
@ApiOperation(value = "登录接口")
public R login(String mobile, String password) {
Assert.isBlank(mobile, "手机号不能为空");
Assert.isBlank(password, "密码不能为空");
AbstractAssert.isBlank(mobile, "手机号不能为空");
AbstractAssert.isBlank(password, "密码不能为空");

//用户登录
long userId = userService.login(mobile, password);
Expand Down Expand Up @@ -214,7 +212,7 @@ public Object loginByCode(@PathVariable String code) {
@ApiOperation(value = "支付宝登录")
@IgnoreAuth
@PostMapping("login_by_ali")
public Object login_by_ali() {
public Object loginByAli() {
JSONObject jsonParam = this.getJsonRequest();
String code = "";
if (!StringUtils.isNullOrEmpty(jsonParam.getString("code"))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class ApiBrandController extends ApiBaseAction {
public Object list(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "size", defaultValue = "10") Integer size) {
//查询列表数据
Map params = new HashMap();
Map<String, Object> params = new HashMap<>();
params.put("fields", "id, name, floor_price, app_list_pic_url");
params.put("page", page);
params.put("limit", size);
Expand All @@ -62,7 +62,7 @@ public Object list(@RequestParam(value = "page", defaultValue = "1") Integer pag
@IgnoreAuth
@PostMapping("detail")
public Object detail(@RequestParam Integer id) {
Map<String, Object> resultObj = new HashMap();
Map<String, Object> resultObj = new HashMap<>();
//查询列表数据
BrandVo entity = brandService.queryObject(id);
//
Expand Down
Loading

0 comments on commit 2b0e1ef

Please sign in to comment.