|
|
@@ -0,0 +1,95 @@
|
|
|
+package com.style24.front.biz.web;
|
|
|
+
|
|
|
+import com.gagaframework.web.rest.server.GagaResponse;
|
|
|
+import com.style24.core.biz.service.TscEnvsetService;
|
|
|
+import com.style24.core.support.env.TscConstants;
|
|
|
+import com.style24.core.support.message.TscMessageByLocale;
|
|
|
+import com.style24.front.biz.service.TsfCustomerService;
|
|
|
+import com.style24.front.support.controller.TsfBaseController;
|
|
|
+import com.style24.front.support.security.session.TsfSession;
|
|
|
+import com.style24.persistence.domain.Customer;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+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.ResponseBody;
|
|
|
+import org.springframework.web.servlet.ModelAndView;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 앱 관련 Controller
|
|
|
+ *
|
|
|
+ * @author jsshin
|
|
|
+ * @since 2021. 05. 21
|
|
|
+ */
|
|
|
+@Controller
|
|
|
+@RequestMapping("/app")
|
|
|
+@Slf4j
|
|
|
+public class TsfAppController extends TsfBaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TscMessageByLocale message;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TsfCustomerService customerService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TscEnvsetService envsetService;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 앱 설정 화면
|
|
|
+ *
|
|
|
+ * @author jsshin
|
|
|
+ * @since 2020. 5. 11
|
|
|
+ */
|
|
|
+ @GetMapping("/setting/form")
|
|
|
+ public ModelAndView getSettingForm() {
|
|
|
+ ModelAndView mav = new ModelAndView();
|
|
|
+
|
|
|
+ // 정책에 등록된 앱버전
|
|
|
+ if (TsfSession.getAttribute("osType").equals("I")) {
|
|
|
+ mav.addObject("regAppVersion",envsetService.getIosAppVersion(TscConstants.Site.STYLE24.value()));
|
|
|
+ } else if (TsfSession.getAttribute("osType").equals("A")) {
|
|
|
+ mav.addObject("regAppVersion",envsetService.getAosAppVersion(TscConstants.Site.STYLE24.value()));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 앱푸시수신동의 가져오기
|
|
|
+ mav.addObject("appAgreeYn", customerService.getAppAgreeYn());
|
|
|
+ mav.addObject("appMkAgreeYn", customerService.getAppMkAgreeYn());
|
|
|
+ mav.addObject("isLogin", TsfSession.isLogin());
|
|
|
+ mav.setViewName("mob/app/SettingFormMob");
|
|
|
+ return mav;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 앱푸시 수신동의
|
|
|
+ *
|
|
|
+ * @param customer - 수신동의 여부
|
|
|
+ * @author jsshin
|
|
|
+ * @since 2021. 05. 20
|
|
|
+ */
|
|
|
+ @PostMapping("/appagree/update")
|
|
|
+ @ResponseBody
|
|
|
+ public GagaResponse updateAppAgreeYn(@RequestBody Customer customer) {
|
|
|
+ customerService.updateAppAgreeYn(customer.getAppAgreeYn());
|
|
|
+ return super.ok(message.getMessage("SUCC_0004"));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 앱마케팅 수신동의
|
|
|
+ *
|
|
|
+ * @param customer - 수신동의 여부
|
|
|
+ * @author jsshin
|
|
|
+ * @since 2021. 05. 20
|
|
|
+ */
|
|
|
+ @PostMapping("/mkagree/update")
|
|
|
+ @ResponseBody
|
|
|
+ public GagaResponse updateMkAgreeYn(@RequestBody Customer customer) {
|
|
|
+ customerService.updateMkAgreeYn(customer.getMkAgreeYn());
|
|
|
+ return super.ok(message.getMessage("SUCC_0004"));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|