| @ -1,17 +1,54 @@ | |||||
| package com.ruoyi.applet.contoller; | package com.ruoyi.applet.contoller; | ||||
| import com.ruoyi.common.core.domain.AjaxResult; | |||||
| import com.ruoyi.model.domain.AppletAddress; | |||||
| import com.ruoyi.model.domain.AppletOutDate; | |||||
| import com.ruoyi.model.service.IAppletAddressService; | |||||
| import com.ruoyi.model.service.IAppletOutDateService; | |||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import java.util.List; | |||||
| @Api(description = "小程序-地址相关接口") | @Api(description = "小程序-地址相关接口") | ||||
| @RestController | @RestController | ||||
| @RequestMapping("/applet/address") | @RequestMapping("/applet/address") | ||||
| public class ApiAppletAddressController { | public class ApiAppletAddressController { | ||||
| @Autowired | |||||
| private IAppletAddressService appletAddressService; | |||||
| @ApiOperation("地址-地址列表数据查询") | |||||
| @GetMapping("/addressList") | |||||
| public AjaxResult outDateList(AppletAddress appletAddress){ | |||||
| List<AppletAddress> addressList = appletAddressService.selectAppletAddressList(appletAddress); | |||||
| return AjaxResult.success("地址列表数据",addressList); | |||||
| } | |||||
| @ApiOperation("地址-地址添加") | |||||
| @PostMapping("/insertAddress") | |||||
| public AjaxResult insertOutDate(@RequestBody AppletAddress appletAddress){ | |||||
| return toAjax(appletAddressService.insertAppletAddress(appletAddress)); | |||||
| } | |||||
| @ApiOperation("地址-地址修改") | |||||
| @PostMapping("/udpateAddress") | |||||
| public AjaxResult udpateOutDate(@RequestBody AppletAddress appletAddress){ | |||||
| return toAjax(appletAddressService.updateAppletAddress(appletAddress)); | |||||
| } | |||||
| @ApiOperation("地址-地址删除") | |||||
| @PostMapping("/deleteAddress") | |||||
| public AjaxResult deleteOutDate(long id){ | |||||
| return toAjax(appletAddressService.deleteAppletAddressById(id)); | |||||
| } | |||||
| protected AjaxResult toAjax(int rows) { | |||||
| return rows > 0 ? AjaxResult.success() : AjaxResult.error(); | |||||
| } | |||||
| } | } | ||||