productInfoVOs;
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/com/imooc/sell/VO/ResultVO.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Project Name:sell.
4 | * File Name:ResultVO.java.
5 | * Package Name:com.imooc.sell.VO.
6 | * Date:2017年12月11日上午11:25:48.
7 | * Copyright (c) 2017, 版权所有 (C) 2016-2036 土豆互联科技(深圳)有限公司 www.potato369.com All Rights Reserved.
8 | */
9 |
10 | package com.imooc.sell.VO;
11 |
12 | //import com.fasterxml.jackson.annotation.JsonInclude;
13 |
14 | import lombok.Data;
15 |
16 | import java.io.Serializable;
17 |
18 | /**
19 | *
20 | * @ClassName:ResultVO
21 | * @Function:ADD FUNCTION
22 | * @Reason:Http请求返回的最外层对象
23 | * @Date:2017年12月11日 上午11:25:48
24 | * @Desc:ADD DESC(可选)
25 | * @Author 王艳军
26 | * @Version
27 | * @Since JDK 1.6
28 | *
29 | */
30 | @Data
31 | //@JsonInclude(JsonInclude.Include.NON_NULL)
32 | public class ResultVO implements Serializable{
33 |
34 | private static final long serialVersionUID = 8848731630266574133L;
35 |
36 | /**
37 | * code:返回的错误码
38 | */
39 | private Integer code;
40 |
41 | /**
42 | * msg:返回的提示信息
43 | */
44 | private String msg;
45 |
46 | /**
47 | * data:返回的具体内容
48 | */
49 | private T data;
50 | }
51 |
--------------------------------------------------------------------------------
/src/main/java/com/imooc/sell/service/PayService.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Project Name:sell.
4 | * File Name:PayService.java.
5 | * Package Name:com.imooc.sell.service.
6 | * Date:2017年12月13日下午9:29:35.
7 | * Copyright (c) 2017, 版权所有 (C) 2016-2036 土豆互联科技(深圳)有限公司 www.potato369.com All Rights Reserved.
8 | */
9 |
10 | package com.imooc.sell.service;
11 |
12 | import com.imooc.sell.dto.OrderDTO;
13 | import com.lly835.bestpay.model.PayResponse;
14 | import com.lly835.bestpay.model.RefundResponse;
15 |
16 | /**
17 | * ClassName: PayService
18 | * Function: ADD FUNCTION
19 | * Reason: 支付订单
20 | * Date: 2017年12月13日 下午9:29:35
21 | * Desc: ADD DESC(可选)
22 | * @author 王艳军
23 | * @version
24 | * @since JDK 1.6
25 | */
26 | public interface PayService {
27 |
28 | /**
29 | * 微信公众号支付订单
30 | * @param orderDTO
31 | * @return
32 | */
33 | PayResponse create(OrderDTO orderDTO);
34 |
35 | /**
36 | * 微信公众号支付异步通知结果
37 | * @param notifyData
38 | */
39 | PayResponse notify(String notifyData);
40 |
41 | /**
42 | * 微信公众号支付退款
43 | * @param orderDTO
44 | */
45 | RefundResponse refund(OrderDTO orderDTO);
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/java/com/imooc/sell/VO/BookStoreResultVO.java:
--------------------------------------------------------------------------------
1 | package com.imooc.sell.VO;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 |
6 | import java.io.Serializable;
7 |
8 | /**
9 | *
10 | * @PackageName com.imooc.sell.VO
11 | * @ClassName BookStoreResultVO
12 | * @Desc 返回书城书籍数据结果
13 | * @WebSite https://www.potato369.com
14 | * @Author 王艳军
15 | * @Date 2018/11/14 17:00
16 | * @CreateBy IntellJ IDEA 2018.2.4
17 | * @Copyright Copyright (c) 2016 ~ 2020 版权所有 (C) 土豆互联科技(深圳)有限公司 https://www.potato369.com All Rights Reserved。
18 | *
19 | */
20 | @Data
21 | public class BookStoreResultVO implements Serializable {
22 |
23 | /**
24 | * errorCode:返回的错误码信息
25 | */
26 | @JsonProperty(value = "error_code")
27 | private Integer errorCode;
28 |
29 | /**
30 | * message:返回的提示信息
31 | */
32 | @JsonProperty(value = "msg")
33 | private String message;
34 |
35 | /**
36 | * data:返回的具体数据信息
37 | */
38 | @JsonProperty(value = "data")
39 | private T data;
40 |
41 | /**
42 | * total:返回的数据总条数
43 | */
44 | @JsonProperty(value = "total")
45 | private Long total;
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/com/imooc/sell/form/CategoryForm.java:
--------------------------------------------------------------------------------
1 | package com.imooc.sell.form;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 | import java.util.Date;
8 | /**
9 | *
10 | * @Description 卖家商品类目表单From
11 | * @Author 王艳军
12 | * @Date 2017-12-17 10:41
13 | *
14 | */
15 | @Data
16 | @Builder
17 | @NoArgsConstructor
18 | @AllArgsConstructor
19 | public class CategoryForm {
20 |
21 | /**
22 | *
23 | * categoryId:类目id
24 | *
25 | */
26 | private Integer categoryId;
27 |
28 | /**
29 | *
30 | * categoryName:类目名称
31 | *
32 | */
33 | private String categoryName;
34 |
35 | /**
36 | *
37 | * categoryType:类目编号
38 | *
39 | */
40 | private Integer categoryType;
41 |
42 | /**
43 | *
44 | * isDeleted:此类目是否标记已删除,默认否
45 | *
46 | */
47 | private Integer isDeleted;
48 |
49 | /**
50 | *
51 | * createTime:创建时间
52 | *
53 | */
54 | private Date createTime;
55 |
56 | /**
57 | *
58 | * updateTime:修改时间
59 | *
60 | */
61 | private Date updateTime;
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/resources/templates/common/success.ftl:
--------------------------------------------------------------------------------
1 |
2 | <#include "../common/header.ftl">
3 |
4 |
5 | <#--边栏 sidebar-->
6 | <#include "../common/nav.ftl">
7 | <#--主体内容区域 content-->
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | 成功!
16 |
${msg}3s后自动跳转
17 |
18 |
19 |
20 |
21 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/test/java/com/imooc/sell/service/impl/SellerServiceImplTest.java:
--------------------------------------------------------------------------------
1 | package com.imooc.sell.service.impl;
2 |
3 | import com.imooc.sell.SellApplication;
4 | import com.imooc.sell.dataobject.SellerInfo;
5 | import org.junit.Test;
6 | import org.junit.runner.RunWith;
7 | import org.springframework.beans.factory.annotation.Autowired;
8 | import org.springframework.boot.test.context.SpringBootTest;
9 | import org.springframework.test.annotation.Rollback;
10 | import org.springframework.test.context.junit4.SpringRunner;
11 | import org.springframework.transaction.annotation.Transactional;
12 |
13 | import static org.junit.Assert.*;
14 | @Rollback
15 | @Transactional
16 | @RunWith(SpringRunner.class)
17 | @SpringBootTest(classes = SellApplication.class, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
18 | public class SellerServiceImplTest {
19 |
20 | @Autowired
21 | private SellerServiceImpl sellerService;
22 |
23 | public static final String SELLER_OPENID = "oSkiNv4fBXYxidv0wU_U0UDHNP4M";
24 |
25 | @Test
26 | public void findSellerInfoByOpenidTest() {
27 | SellerInfo result = sellerService.findSellerInfoByOpenid(SELLER_OPENID);
28 | assertEquals(SELLER_OPENID, result.getOpenid());
29 | }
30 | }
--------------------------------------------------------------------------------
/src/main/java/com/imooc/sell/exception/SellException.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Project Name:sell.
4 | * File Name:SellException.java.
5 | * Package Name:com.imooc.sell.exception.
6 | * Date:2017年12月11日上午10:33:22.
7 | * Copyright (c) 2017, 版权所有 (C) 2016-2036 土豆互联科技(深圳)有限公司 www.potato369.com All Rights Reserved.
8 | */
9 |
10 | package com.imooc.sell.exception;
11 |
12 | import com.imooc.sell.enums.ResultEnum;
13 |
14 | import lombok.Getter;
15 |
16 | /**
17 | * ClassName: SellException.
18 | * Function: ADD FUNCTION.
19 | * Reason: ADD REASON(可选).
20 | * Date: 2017年12月11日 上午10:33:22.
21 | * Desc: ADD DESC(可选).
22 | * @author 王艳军
23 | * @version
24 | * @since JDK 1.6
25 | */
26 | @Getter
27 | public class SellException extends RuntimeException{
28 |
29 | private static final long serialVersionUID = -3170669599060979531L;
30 |
31 | private Integer code;
32 |
33 | public SellException(ResultEnum resultEnum) {
34 | super(resultEnum.getMessage());
35 | this.code = resultEnum.getCode();
36 | }
37 |
38 | public SellException(Integer code, String message) {
39 | super(message);
40 | this.code = code;
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/src/test/java/com/imooc/sell/LoggerTest.java:
--------------------------------------------------------------------------------
1 | package com.imooc.sell;
2 |
3 | import lombok.extern.slf4j.Slf4j;
4 | import org.junit.Test;
5 | import org.junit.runner.RunWith;
6 | import org.springframework.boot.test.context.SpringBootTest;
7 | import org.springframework.test.context.junit4.SpringRunner;
8 |
9 | /**
10 | *
11 | * @PackageName com.imooc.sell
12 | * @ClassName LoggerTest
13 | * @Desc 测试日志输出框架slog4j和logback
14 | * @WebSite https://www.potato369.com
15 | * @Author 王艳军
16 | * @Date 2018/10/10 11:05
17 | * @CreateBy IntellJ IDEA 2018.2.4
18 | * @Copyright Copyright (c) 2016 ~ 2020 版权所有 (C) 土豆互联科技(深圳)有限公司 https://www.potato369.com All Rights Reserved。
19 | *
20 | */
21 | @Slf4j
22 | @RunWith(SpringRunner.class)
23 | @SpringBootTest(classes = SellApplication.class, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
24 | public class LoggerTest {
25 |
26 | @Test
27 | public void test() {
28 | log.debug("debug......");
29 | log.info("info......");
30 | log.error("error......");
31 | String name = "imooc", password ="123456";
32 | log.info("name = {}, password = {}", name, password);
33 | log.info("name: {}, password: {}", name, password);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/com/imooc/sell/service/OrderDetailService.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Project Name:sell.
4 | * File Name:OrderDetailService.java.
5 | * Package Name:com.imooc.sell.service.impl.
6 | * Date:2017年12月18日下午9:01:22.
7 | * Copyright (c) 2017, 版权所有 (C) 2016-2036 土豆互联科技(深圳)有限公司 www.potato369.com All Rights Reserved.
8 | */
9 |
10 | package com.imooc.sell.service;
11 |
12 | import java.util.List;
13 |
14 | import com.imooc.sell.dataobject.OrderDetail;
15 | import com.imooc.sell.dataobject.ProductInfo;
16 |
17 | /**
18 | * 订单详情service
19 | * ClassName: OrderDetailService.
20 | * Function: ADD FUNCTION.
21 | * Reason: ADD REASON(可选).
22 | * Date: 2017年12月18日 下午9:01:22.
23 | * Desc: ADD DESC(可选).
24 | * @author 王艳军
25 | * @version
26 | * @since JDK 1.6
27 | */
28 |
29 | public interface OrderDetailService {
30 |
31 | /**
32 | * 根据订单id查询订单详情列表信息
33 | * @param orderId
34 | * @return
35 | */
36 | List findOrderDetailByOrderId(String orderId);
37 |
38 | /**
39 | * 根据订单id查询订购的商品信息
40 | * @param orderId
41 | * @return
42 | */
43 | List findProductInfoByOrderId(String orderId);
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/com/imooc/sell/form/BookCategoryForm.java:
--------------------------------------------------------------------------------
1 | package com.imooc.sell.form;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | /**
9 | *
10 | * @PackageName com.imooc.sell.form
11 | * @ClassName BookCategoryForm
12 | * @Desc 书籍类目数据Form
13 | * @WebSite https://www.potato369.com
14 | * @Author 王艳军
15 | * @Date 2018/11/14 19:12
16 | * @CreateBy IntellJ IDEA 2018.2.4
17 | * @Copyright Copyright (c) 2016 ~ 2020 版权所有 (C) 土豆互联科技(深圳)有限公司 https://www.potato369.com All Rights Reserved。
18 | *
19 | */
20 | @Data
21 | @Builder
22 | @NoArgsConstructor
23 | @AllArgsConstructor
24 | public class BookCategoryForm {
25 |
26 | /**
27 | * categoryId:类目id,主键
28 | */
29 | private Integer categoryId;
30 |
31 | /**
32 | * parentCategoryId:父级类目id
33 | */
34 | private Integer parentCategoryId;
35 |
36 | /**
37 | * categoryName:类目名称
38 | */
39 | private String categoryName;
40 |
41 | /**
42 | * categoryType:类目编号
43 | */
44 | private Integer categoryType;
45 |
46 | /**
47 | * isDeleted:类目是否删除,0-否;1-是,“默认:0-否”
48 | */
49 | private Integer isDeleted;
50 | }
51 |
--------------------------------------------------------------------------------
/src/main/java/com/imooc/sell/utils/BookStoreResultVOUtils.java:
--------------------------------------------------------------------------------
1 | package com.imooc.sell.utils;
2 |
3 | import com.imooc.sell.VO.BookStoreResultVO;
4 | import com.imooc.sell.VO.ResultVO;
5 |
6 | /**
7 | *
8 | * @PackageName com.imooc.sell.utils
9 | * @ClassName BookStoreResultVOUtils
10 | * @Desc 返回结果数据工具类
11 | * @WebSite https://www.potato369.com
12 | * @Author 王艳军
13 | * @Date 2018/11/14 17:08
14 | * @CreateBy IntellJ IDEA 2018.2.4
15 | * @Copyright Copyright (c) 2016 ~ 2020 版权所有 (C) 土豆互联科技(深圳)有限公司 https://www.potato369.com All Rights Reserved。
16 | *
17 | */
18 | public class BookStoreResultVOUtils {
19 | public static BookStoreResultVO success(Object object){
20 | BookStoreResultVO resultVO = new BookStoreResultVO();
21 | resultVO.setErrorCode(0);
22 | resultVO.setMessage("获取成功");
23 | resultVO.setData(object);
24 | return resultVO;
25 | }
26 |
27 | public static BookStoreResultVO success(){
28 | return success(null);
29 | }
30 |
31 | public static BookStoreResultVO error(Integer code, String msg){
32 | BookStoreResultVO resultVO = new BookStoreResultVO();
33 | resultVO.setErrorCode(code);
34 | resultVO.setMessage(msg);
35 | return resultVO;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/com/imooc/sell/handler/MenuHandler.java:
--------------------------------------------------------------------------------
1 | package com.imooc.sell.handler;
2 |
3 | import me.chanjar.weixin.common.session.WxSessionManager;
4 | import me.chanjar.weixin.mp.api.WxMpService;
5 | import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
6 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
7 | import org.springframework.stereotype.Component;
8 |
9 | import java.util.Map;
10 |
11 | import static me.chanjar.weixin.common.api.WxConsts.MenuButtonType;
12 |
13 | /**
14 | * @author Binary Wang(https://github.com/binarywang)
15 | */
16 | @Component
17 | public class MenuHandler extends AbstractHandler {
18 |
19 | @Override
20 | public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
21 | Map context, WxMpService weixinService,
22 | WxSessionManager sessionManager) {
23 |
24 | String msg = String.format("type:%s, event:%s, key:%s",
25 | wxMessage.getMsgType(), wxMessage.getEvent(),
26 | wxMessage.getEventKey());
27 | if (MenuButtonType.VIEW.equals(wxMessage.getEvent())) {
28 | return null;
29 | }
30 |
31 | return WxMpXmlOutMessage.TEXT().content(msg)
32 | .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser())
33 | .build();
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/com/imooc/sell/utils/ResultVOUtil.java:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Project Name:sell.
4 | * File Name:ResultVOUtil.java.
5 | * Package Name:com.imooc.sell.utils.
6 | * Date:2017年12月11日下午2:25:03.
7 | * Copyright (c) 2017, 版权所有 (C) 2016-2036 土豆互联科技(深圳)有限公司 www.potato369.com All Rights Reserved.
8 | */
9 |
10 | package com.imooc.sell.utils;
11 |
12 | import com.imooc.sell.VO.ResultVO;
13 |
14 | /**
15 | * ClassName: ResultVOUtil.
16 | * Function: ADD FUNCTION.
17 | * Reason: ADD REASON(可选).
18 | * Date: 2017年12月11日 下午2:25:03.
19 | * Desc: ADD DESC(可选).
20 | * @author 王艳军
21 | * @version
22 | * @since JDK 1.6
23 | */
24 |
25 | public class ResultVOUtil{
26 |
27 | public static ResultVO success(Object object){
28 | ResultVO resultVO = new ResultVO();
29 | resultVO.setCode(0);
30 | resultVO.setMsg("成功");
31 | resultVO.setData(object);
32 | return resultVO;
33 | }
34 |
35 | public static ResultVO success(){
36 | return success(null);
37 | }
38 |
39 | public static ResultVO error(Integer code, String msg){
40 | ResultVO resultVO = new ResultVO();
41 | resultVO.setCode(code);
42 | resultVO.setMsg(msg);
43 | return resultVO;
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/ReadMe.md:
--------------------------------------------------------------------------------
1 | # 微信开放平台的开发使用
2 | > 本文档仅针对问我借用账号的情况, 如果自己有开放账号, 可直接按照慕课网视频或者微信文档开发
3 | 1、 准备好openid和网址, openid是之前邮件发给我的那个,网址的host保证与之前发的一样, 比如之前发给我的网址是`http://abc.natapp.cc`, 那么这次使用的网址必须是`http://abc.natapp.cc`开头
4 | 2. 电脑浏览器下面的链接, 注意替换openid和你的网址(需要urlEncode)
5 |
6 | ```
7 | https://open.weixin.qq.com/connect/qrconnect?appid=wx6ad144e54af67d87&redirect_uri=http%3A%2F%2Fsell.springboot.cn%2Fsell%2Fqr%2F{OPENID}&response_type=code&scope=snsapi_login&state={你的网址}
8 | ```
9 | 3、 最后会重定向到`你的网址?code=xxxxxxxxxxx`
10 | 4、例子
11 |
12 | openid是oTgZpweNnfivA9ER9EIXoHAjlrWQ
13 | 之前邮件发送的网址是http://coding.imooc.com
14 | 这次使用的网址是http://coding.imooc.com/class/117.html
15 | 那么访问的地址为
16 |
17 | ```
18 | https://open.weixin.qq.com/connect/qrconnect?appid=wx6ad144e54af67d87&redirect_uri=http%3A%2F%2Fsell.springboot.cn%2Fsell%2Fqr%2FoTgZpweNnfivA9ER9EIXoHAjlrWQ&response_type=code&scope=snsapi_login&state=http%3A%2F%2Fcoding.imooc.com%2Fclass%2F117.html
19 | ```
20 |
21 | 最后会重定向到
22 |
23 | ```
24 | http://coding.imooc.com/class/117.html?code=001bitQu0uteYd13BsQu0TetQu0bitQ
25 | ```
26 | 拿到code之后即可获取扫码者的openid了, 还不清楚? 请观看慕课网《Spring Boot企业微信点餐系统》第12章卖家扫码登录部分
27 | 5、 问:扫码之后, pc端不会跳转是什么原因?
28 | 答:{你的网址}不能访问
29 |
30 | 6、有兴趣的童鞋可以共同参与开发,可以添加我的微信号:wx406151651,QQ:406151651共同参与开发讨论。谢谢合作!!!
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/main/java/com/imooc/sell/utils/JsonUtils.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * Project Name: sell
4 | * File Name: JsonUtils.java
5 | * Package Name: com.imooc.sell.utils
6 | * Create Date: 2018年11月29日 下午12:12:50
7 | * Copyright (c) 2018, 版权所有 (C) 2016-2036 土豆互联科技(深圳)有限公司 www.potato369.com All Rights Reserved
8 | *
9 | */
10 | package com.imooc.sell.utils;
11 |
12 | import com.google.gson.Gson;
13 | import com.google.gson.GsonBuilder;
14 |
15 | import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
16 |
17 | /**
18 | *
19 | * @PackageName com.imooc.sell.utils
20 | * @ClassName JsonUtils
21 | * @Desc Json字符串或者对象处理工具类
22 | * @WebSite https://www.potato369.com
23 | * @Author 王艳军
24 | * @Date 2018年11月29日 下午12:12:50
25 | * @CreateBy Eclipse IDEA Neon.3 Release(4.6.3)
26 | * @Copyright Copyright (c) 2016 ~ 2020 版权所有 (C) 土豆互联科技(深圳)有限公司 https://www.potato369.com All Rights Reserved。
27 | *
28 | */
29 | public class JsonUtils {
30 | public static String toJson(Object obj) {
31 | return WxMpGsonBuilder.create().toJson(obj);
32 | }
33 |
34 | public static String toJsonStr(Object object) {
35 | GsonBuilder gsonBuilder = new GsonBuilder();
36 | gsonBuilder.setPrettyPrinting();
37 | Gson gson = gsonBuilder.create();
38 | return gson.toJson(object);
39 | }
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/src/main/resources/static/pay.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/main/java/com/imooc/sell/config/WechatOpenConfig.java:
--------------------------------------------------------------------------------
1 | package com.imooc.sell.config;
2 |
3 | import me.chanjar.weixin.mp.api.WxMpConfigStorage;
4 | import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
5 | import me.chanjar.weixin.mp.api.WxMpService;
6 | import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
7 | import org.springframework.beans.factory.annotation.Autowired;
8 | import org.springframework.context.annotation.Bean;
9 |
10 | import com.imooc.sell.config.prop.WechatMpProperties;
11 |
12 | /**
13 | * @Author 王艳军
14 | * @Date 2017-12-17 14:38
15 | */
16 | public class WechatOpenConfig {
17 |
18 | @Autowired
19 | private WechatMpProperties wechatMpConfig;
20 |
21 | @Bean
22 | public WxMpService wxOpenService(){
23 | WxMpService wxOpenService = new WxMpServiceImpl();
24 | wxOpenService.setWxMpConfigStorage(wxOpenConfigStorage());
25 | return wxOpenService;
26 | }
27 |
28 | @Bean
29 | private WxMpConfigStorage wxOpenConfigStorage(){
30 | WxMpInMemoryConfigStorage wxOpenInMemoryConfigStorage = new WxMpInMemoryConfigStorage();
31 | wxOpenInMemoryConfigStorage.setAppId(wechatMpConfig.getOpenAppid());
32 | wxOpenInMemoryConfigStorage.setSecret(wechatMpConfig.getOpenAppSecret());
33 | return wxOpenInMemoryConfigStorage;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/com/imooc/sell/enums/BookStatusEnum.java:
--------------------------------------------------------------------------------
1 | package com.imooc.sell.enums;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Getter;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | *
9 | * @PackageName com.imooc.sell.enums
10 | * @EnumName BookStatusEnum
11 | * @Desc 书籍状态枚举
12 | * @WebSite https://www.potato369.com
13 | * @Author 王艳军
14 | * @Date 2018/11/14 18:29
15 | * @CreateBy IntellJ IDEA 2018.2.4
16 | * @Copyright Copyright (c) 2016 ~ 2020 版权所有 (C) 土豆互联科技(深圳)有限公司 https://www.potato369.com All Rights Reserved。
17 | *
18 | */
19 | @Getter
20 | @NoArgsConstructor
21 | @AllArgsConstructor
22 | public enum BookStatusEnum implements CodeEnum