Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gogirl-miniapp-backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huluobin
gogirl-miniapp-backend
Commits
62726cc1
Commit
62726cc1
authored
Mar 10, 2021
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# 文档
parent
12d6bd1e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
112 additions
and
2 deletions
+112
-2
README.md
README.md
+110
-0
MallCustomerAddressController.java
.../interfaces/order/mall/MallCustomerAddressController.java
+2
-2
No files found.
README.md
0 → 100644
View file @
62726cc1
# gogirl小程序后端
## 如何使用
swagger: http://134.175.167.230:5555/doc.html
## 项目结构
```
└── com
└── gogirl
├── GogirlMiniappApplication.java
├── application
│ ├── common //通用服务
│ ├── customer //用户服务
│ ├── dashboard //店员看板服务
│ ├── market //营销服务
│ ├── order //订单服务
│ ├── product //产品服务
│ ├── store //店铺服务
│ └── user //用户服务(旧)
├── assembler //转换器
├── domain //实体领域层
├── infrastructure //基础设施层
│ ├── common //应用通用组件配置
│ ├── feign //三方api调用
│ ├── mapper //数据库mapper
│ ├── schedule //应用定时任务
│ └── service //基础服务
├── interfaces //REST API
└── shared //dto
```
## 如何开发
### 代码生成器
test/java/com/gogirl/CodeGenerator
### controller
```
java
@Api
(
tags
=
"商城收货地址接口"
)
@RestController
@AllArgsConstructor
public
class
MallCustomerAddressController
{
private
final
MallCustomerAddressService
mallCustomerAddressService
;
@ApiOperation
(
"新增收货地址"
)
@PostMapping
(
"/customer/customerAddress/addMallCustomerAddress"
)
public
JsonResult
<
MallCustomerAddress
>
addMallCustomerAddress
(
@RequestBody
MallCustomerAddress
mallCustomerAddress
)
{
Integer
currentCustomerId
=
SessionUtils
.
getCustomerId
();
mallCustomerAddress
.
setCustomerId
(
currentCustomerId
);
mallCustomerAddress
.
setIsDefault
(
MallCustomerAddress
.
IS_DEFAULT_FALSE
);
mallCustomerAddressService
.
addMallCustomerAddress
(
mallCustomerAddress
);
return
JsonResult
.
success
(
mallCustomerAddress
);
}
}
```
#### service
```
java
public
interface
MallCustomerAddressService
extends
IService
<
MallCustomerAddress
>
{
/**
* 新增收货地址
*
* @param mallCustomerAddress 收货地址
*/
void
addMallCustomerAddress
(
MallCustomerAddress
mallCustomerAddress
);
}
@Service
public
class
MallCustomerAddressServiceImpl
extends
ServiceImpl
<
MallCustomerAddressMapper
,
MallCustomerAddress
>
implements
MallCustomerAddressService
{
@Override
public
void
addMallCustomerAddress
(
MallCustomerAddress
mallCustomerAddress
)
{
this
.
save
(
mallCustomerAddress
);
}
}
```
#### mapper
```
java
public
interface
MallCustomerAddressMapper
extends
BaseMapper
<
MallCustomerAddress
>
{
}
```
### 发布
1.
提交代码
```
shell script
git commit push
```
2.
登陆发布服务器
```
shell script
ssh root@http://134.175.167.230/
```
3.
发布测试环境
```
shell script
sh /deploy-miniapp-pre.sh
```
> 注意修改测试分支
4.
发布正式环境
```
shell script
sh /deploy-miniapp-prod.sh
```
src/main/java/com/gogirl/interfaces/order/mall/MallCustomerAddressController.java
View file @
62726cc1
...
@@ -11,14 +11,14 @@ import org.springframework.web.bind.annotation.*;
...
@@ -11,14 +11,14 @@ import org.springframework.web.bind.annotation.*;
import
java.util.List
;
import
java.util.List
;
@Api
(
tags
=
"商城收
获
地址接口"
)
@Api
(
tags
=
"商城收
货
地址接口"
)
@RestController
@RestController
@AllArgsConstructor
@AllArgsConstructor
public
class
MallCustomerAddressController
{
public
class
MallCustomerAddressController
{
private
final
MallCustomerAddressService
mallCustomerAddressService
;
private
final
MallCustomerAddressService
mallCustomerAddressService
;
@ApiOperation
(
"新增收
获
地址"
)
@ApiOperation
(
"新增收
货
地址"
)
@PostMapping
(
"/customer/customerAddress/addMallCustomerAddress"
)
@PostMapping
(
"/customer/customerAddress/addMallCustomerAddress"
)
public
JsonResult
<
MallCustomerAddress
>
addMallCustomerAddress
(
@RequestBody
MallCustomerAddress
mallCustomerAddress
)
{
public
JsonResult
<
MallCustomerAddress
>
addMallCustomerAddress
(
@RequestBody
MallCustomerAddress
mallCustomerAddress
)
{
Integer
currentCustomerId
=
SessionUtils
.
getCustomerId
();
Integer
currentCustomerId
=
SessionUtils
.
getCustomerId
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment