Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
mall
Commits
9523e3ac
Commit
9523e3ac
authored
Oct 16, 2018
by
zhh
Browse files
添加订单设置接口
parent
87053201
Changes
3
Hide whitespace changes
Inline
Side-by-side
mall-admin/src/main/java/com/macro/mall/controller/OmsOrderSettingController.java
0 → 100644
View file @
9523e3ac
package
com.macro.mall.controller
;
import
com.macro.mall.dto.CommonResult
;
import
com.macro.mall.model.OmsOrderSetting
;
import
com.macro.mall.service.OmsOrderSettingService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.*
;
/**
* 订单设置Controller
* Created by macro on 2018/10/16.
*/
@Controller
@Api
(
tags
=
"OmsOrderSettingController"
,
description
=
"订单设置管理"
)
@RequestMapping
(
"/orderSetting"
)
public
class
OmsOrderSettingController
{
@Autowired
private
OmsOrderSettingService
orderSettingService
;
@ApiOperation
(
"获取指定订单设置"
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
Object
getItem
(
@PathVariable
Long
id
)
{
OmsOrderSetting
orderSetting
=
orderSettingService
.
getItem
(
id
);
return
new
CommonResult
().
success
(
orderSetting
);
}
@ApiOperation
(
"修改指定订单设置"
)
@RequestMapping
(
value
=
"/update/{id}"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
update
(
@PathVariable
Long
id
,
@RequestBody
OmsOrderSetting
orderSetting
)
{
int
count
=
orderSettingService
.
update
(
id
,
orderSetting
);
if
(
count
>
0
){
return
new
CommonResult
().
success
(
count
);
}
return
new
CommonResult
().
failed
();
}
}
mall-admin/src/main/java/com/macro/mall/service/OmsOrderSettingService.java
0 → 100644
View file @
9523e3ac
package
com.macro.mall.service
;
import
com.macro.mall.model.OmsOrderSetting
;
/**
* 订单设置Service
* Created by macro on 2018/10/16.
*/
public
interface
OmsOrderSettingService
{
/**
* 获取指定订单设置
*/
OmsOrderSetting
getItem
(
Long
id
);
/**
* 修改指定订单设置
*/
int
update
(
Long
id
,
OmsOrderSetting
orderSetting
);
}
mall-admin/src/main/java/com/macro/mall/service/impl/OmsOrderSettingServiceImpl.java
0 → 100644
View file @
9523e3ac
package
com.macro.mall.service.impl
;
import
com.macro.mall.mapper.OmsOrderSettingMapper
;
import
com.macro.mall.model.OmsOrderSetting
;
import
com.macro.mall.service.OmsOrderSettingService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* 订单设置管理Service实现类
* Created by macro on 2018/10/16.
*/
@Service
public
class
OmsOrderSettingServiceImpl
implements
OmsOrderSettingService
{
@Autowired
private
OmsOrderSettingMapper
orderSettingMapper
;
@Override
public
OmsOrderSetting
getItem
(
Long
id
)
{
return
orderSettingMapper
.
selectByPrimaryKey
(
id
);
}
@Override
public
int
update
(
Long
id
,
OmsOrderSetting
orderSetting
)
{
orderSetting
.
setId
(
id
);
return
orderSettingMapper
.
updateByPrimaryKey
(
orderSetting
);
}
}
Write
Preview
Supports
Markdown
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