| | |
| | | package com.xiaopeng.account.controller; |
| | | |
| | | import com.xiaopeng.account.model.dto.CollectAddrDTO; |
| | | import com.xiaopeng.account.model.query.XpUserCollectAddrListQuery; |
| | | import com.xiaopeng.account.model.vo.XpAppUserCollectAddrVO; |
| | | import com.xiaopeng.account.service.IXpAppUserCollectAddrService; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.unifiedverification.interceptor.XpClientCheck; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户收藏地址 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author ck |
| | | * @since 2026-04-10 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class XpAppUserCollectAddrController { |
| | | |
| | | private final IXpAppUserCollectAddrService xpAppUserCollectAddrService; |
| | | |
| | | public XpAppUserCollectAddrController(IXpAppUserCollectAddrService xpAppUserCollectAddrService) { |
| | | this.xpAppUserCollectAddrService = xpAppUserCollectAddrService; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 收藏地址/取消收藏地址 |
| | | */ |
| | | @PostMapping("/api/v1/mini-program/collect/addr") |
| | | @ApiOperation(value = "收藏/取消收藏地址", tags = {"小程序-收藏/取消收藏地址"}) |
| | | @XpClientCheck(checkToken = false, checkOtpToken = true) |
| | | public R<String> collectAddr(@Validated @RequestBody CollectAddrDTO dto, HttpServletRequest request) { |
| | | // uid已通过拦截器otp校验,可以直接使用 |
| | | String uid = request.getHeader("XP-Uid"); |
| | | boolean result = xpAppUserCollectAddrService.collectAddr(dto, uid); |
| | | if (result) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取收藏夹收藏地址列表 |
| | | */ |
| | | @PostMapping("/api/v1/mini-program/collect/addrlist") |
| | | @ApiOperation(value = "收藏夹", tags = {"小程序-获取用户收藏夹收藏地址列表"}) |
| | | @XpClientCheck(checkToken = false, checkOtpToken = true) |
| | | public R<PageInfo<XpAppUserCollectAddrVO>> collectAddrlist(@RequestBody XpUserCollectAddrListQuery query, HttpServletRequest request) { |
| | | // uid已通过拦截器otp校验,可以直接使用 |
| | | String uid = request.getHeader("XP-Uid"); |
| | | return R.ok(xpAppUserCollectAddrService.userCollectAddrList(query, uid)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | //package com.xiaopeng.account.controller; |
| | | // |
| | | //import com.xiaopeng.account.model.dto.CollectAddrDTO; |
| | | //import com.xiaopeng.account.model.query.XpUserCollectAddrListQuery; |
| | | //import com.xiaopeng.account.model.vo.XpAppUserCollectAddrVO; |
| | | //import com.xiaopeng.account.service.IXpAppUserCollectAddrService; |
| | | //import com.xiaopeng.common.core.domain.R; |
| | | //import com.xiaopeng.common.core.web.page.PageInfo; |
| | | //import com.xiaopeng.unifiedverification.interceptor.XpClientCheck; |
| | | //import io.swagger.annotations.ApiOperation; |
| | | //import org.springframework.validation.annotation.Validated; |
| | | //import org.springframework.web.bind.annotation.PostMapping; |
| | | //import org.springframework.web.bind.annotation.RequestBody; |
| | | //import org.springframework.web.bind.annotation.RequestMapping; |
| | | //import org.springframework.web.bind.annotation.RestController; |
| | | // |
| | | //import javax.servlet.http.HttpServletRequest; |
| | | // |
| | | ///** |
| | | // * <p> |
| | | // * 用户收藏地址 前端控制器 |
| | | // * </p> |
| | | // * |
| | | // * @author ck |
| | | // * @since 2026-04-10 |
| | | // */ |
| | | //@RestController |
| | | //@RequestMapping("") |
| | | //public class XpAppUserCollectAddrController { |
| | | // |
| | | // private final IXpAppUserCollectAddrService xpAppUserCollectAddrService; |
| | | // |
| | | // public XpAppUserCollectAddrController(IXpAppUserCollectAddrService xpAppUserCollectAddrService) { |
| | | // this.xpAppUserCollectAddrService = xpAppUserCollectAddrService; |
| | | // } |
| | | // |
| | | // |
| | | // /** |
| | | // * 收藏地址/取消收藏地址 |
| | | // */ |
| | | // @PostMapping("/api/v1/mini-program/collect/addr") |
| | | // @ApiOperation(value = "收藏/取消收藏地址", tags = {"小程序-收藏/取消收藏地址"}) |
| | | // @XpClientCheck(checkToken = false, checkOtpToken = true) |
| | | // public R<String> collectAddr(@Validated @RequestBody CollectAddrDTO dto, HttpServletRequest request) { |
| | | // // uid已通过拦截器otp校验,可以直接使用 |
| | | // String uid = request.getHeader("XP-Uid"); |
| | | // boolean result = xpAppUserCollectAddrService.collectAddr(dto, uid); |
| | | // if (result) { |
| | | // return R.ok(); |
| | | // } |
| | | // return R.fail(); |
| | | // } |
| | | // |
| | | // |
| | | // /** |
| | | // * 获取收藏夹收藏地址列表 |
| | | // */ |
| | | // @PostMapping("/api/v1/mini-program/collect/addrlist") |
| | | // @ApiOperation(value = "收藏夹", tags = {"小程序-获取用户收藏夹收藏地址列表"}) |
| | | // @XpClientCheck(checkToken = false, checkOtpToken = true) |
| | | // public R<PageInfo<XpAppUserCollectAddrVO>> collectAddrlist(@RequestBody XpUserCollectAddrListQuery query, HttpServletRequest request) { |
| | | // // uid已通过拦截器otp校验,可以直接使用 |
| | | // String uid = request.getHeader("XP-Uid"); |
| | | // return R.ok(xpAppUserCollectAddrService.userCollectAddrList(query, uid)); |
| | | // } |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | //} |