Xiao Meng 5w received a small blind box program, which was developed in three weeks!

Keywords: Java Database ElasticSearch Mini Program

Today's young people can really play, more and more new things come out, and more and more fun things are popular.

It's like the blind box of the recent fire stall.

Seriously, I didn't know what a blind box was before.

In front of me, a fan asked me to develop a small blind box program. Therefore, I went to the stall and bought some blind boxes to play!

It's fun. It's fun.
 

Then I went to the Internet. Many companies are pushing blind box app s or small programs.

For example, Netease's blind box applet, I have been updating articles on csdn and often receive notifications of their blind box applet.

  Here is what I developed:

 

 

 

 

 

The following is a brief introduction to the small program developed. There are many core areas that may not be open.

catalogue

1, Technical realization:

2, Core code

3, Core database

4, Market positioning:

5, Xiao Meng suggested:

1, Technical realization:

Because the customer doesn't have technical requirements, it's developed according to the technology I'm used to. It doesn't matter whether it's the latest or not.  

Background framework: SpringBoot,

Mysql used in the database,

The back-end pages are developed using Vue,

Redis for caching,

The search engine adopts elastic search,

ORM layer framework: MyBatis,

Connection pool: Druid,

Sub database and sub table: MyCat,

Permissions: Spring security,

Code quality check: sonar.

2, Core code

@Controller
@RequestMapping("/addressInfo")
public class AddressInfoController extends BaseController {

    @Resource
    private AddressInfoService addressInfoService;

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @SetMenuAnnotation
    @RequestMapping("listPage")
    public ModelAndView listPage(ModelAndView modelAndView) {
        modelAndView.setViewName("addressInfo/list");
        return modelAndView;
    }

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @RequestMapping("addPage")
    public String addPage() {
        return "addressInfo/add";
    }

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @RequestMapping("editPage")
    public ModelAndView editPage(ModelAndView modelAndView, Long id) {
        modelAndView.addObject("id", id);
        modelAndView.setViewName("addressInfo/edit");
        return modelAndView;
    }

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @RequestMapping("/getList")
    @ResponseBody
    public ReturnDataForLayui getList(AddressInfo addressInfo) {
        addressInfo.setIsDeleted(PageBean.isDeletedNo);
        return addressInfoService.getList(addressInfo);
    }

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @RequestMapping("/add")
    @ResponseBody
    public ReturnData add(AddressInfo addressInfo) {
        return addressInfoService.add(addressInfo);
    }

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @RequestMapping("/update")
    @ResponseBody
    public ReturnData update(AddressInfo addressInfo) {
        return addressInfoService.update(addressInfo);
    }

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @RequestMapping("/updateDelete")
    @ResponseBody
    public ReturnData updateDelete(AddressInfo addressInfo) {
        addressInfo.setIsDeleted(PageBean.isDeletedYes);
        return addressInfoService.updateDelete(addressInfo);
    }

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @RequestMapping("/updateDeleteBatch")
    @ResponseBody
    public ReturnData updateDeleteBatch(String ids) {
        List<Long> idList = JSON.parseArray(ids, Long.class);
        return addressInfoService.updateDeleteBatch(idList);
    }
package com.cnewdream.controller;

import com.cnewdream.utils.ReturnData;
import com.cnewdream.utils.RedisUtils;

import javax.annotation.Resource;
import javax.servlet.ServletContext;
public class BaseController {

	@Resource
	protected ServletContext servletContext;
	@Resource
	protected RedisUtils redisUtils;

}
@RequestMapping("/blindBoxInfo")
public class BlindBoxInfoController extends BaseController {

    @Resource
    private BlindBoxInfoService blindBoxInfoService;

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @SetMenuAnnotation
    @RequestMapping("listPage")
    public ModelAndView listPage(ModelAndView modelAndView) {
        modelAndView.setViewName("blindBoxInfo/list");
        return modelAndView;
    }

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @RequestMapping("addPage")
    public String addPage() {
        return "blindBoxInfo/add";
    }

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @RequestMapping("editPage")
    public ModelAndView editPage(ModelAndView modelAndView, Long id) {
        modelAndView.addObject("id", id);
        modelAndView.setViewName("blindBoxInfo/edit");
        return modelAndView;
    }

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @RequestMapping("goodsLevelEditPage")
    public ModelAndView goodsLevelEditPage(ModelAndView modelAndView, Long id) {
        BlindBoxInfo blindBoxInfo = new BlindBoxInfo();
        blindBoxInfo.setId(id);
        ReturnDataForLayui list = blindBoxInfoService.getList(blindBoxInfo);
        ArrayList<BlindBoxInfo> blindBoxInfos = (ArrayList<BlindBoxInfo>) list.getData();
        BlindBoxInfo blindBoxInfoDb = blindBoxInfos.get(0);
        String goodsLevel = blindBoxInfoDb.getGoodsLevel();
        GoodsLevelInfo goodsLevelInfo = JSONUtils.json2pojo(goodsLevel, GoodsLevelInfo.class);
        if (goodsLevelInfo == null) {
            goodsLevelInfo = new GoodsLevelInfo();
        }
        goodsLevelInfo.setId(id);
        modelAndView.addObject("goodsLevelInfo", goodsLevelInfo);
        modelAndView.setViewName("blindBoxInfo/goodsLevelEdit");
        return modelAndView;
    }

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @RequestMapping("/getList")
    @ResponseBody
    public ReturnDataForLayui getList(BlindBoxInfo blindBoxInfo) {
        blindBoxInfo.setIsDeleted(PageBean.isDeletedNo);
        return blindBoxInfoService.getList(blindBoxInfo);
    }

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @RequestMapping("/add")
    @ResponseBody
    public ReturnData add(BlindBoxInfo blindBoxInfo) {
        return blindBoxInfoService.add(blindBoxInfo);
    }
@Controller
@RequestMapping("/goodsInfo")
public class GoodsInfoController extends BaseController {

    @Resource
    private GoodsInfoService goodsInfoService;

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @SetMenuAnnotation
    @RequestMapping("listPage")
    public ModelAndView listPage(ModelAndView modelAndView, Long blindId) {
        modelAndView.setViewName("goodsInfo/list");
        modelAndView.addObject("blindId", blindId);
        return modelAndView;
    }

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @RequestMapping("addPage")
    public ModelAndView addPage(ModelAndView modelAndView, Long blindId) {
        modelAndView.addObject("blindId", blindId);
        modelAndView.setViewName("goodsInfo/add");
        return modelAndView;
    }

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @RequestMapping("editPage")
    public ModelAndView editPage(ModelAndView modelAndView, Long id) {
        modelAndView.addObject("id", id);
        modelAndView.setViewName("goodsInfo/edit");
        return modelAndView;
    }

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @RequestMapping("/getList")
    @ResponseBody
    public ReturnDataForLayui getList(GoodsInfo goodsInfo) {
        goodsInfo.setIsDeleted(PageBean.isDeletedNo);
        return goodsInfoService.getList(goodsInfo);
    }

    @MustSetForOrderNoAnnotation
    @AuthenticationAnnotation
    @RequestMapping("/add")
    @ResponseBody
    public ReturnData add(GoodsInfo goodsInfo) {
        return goodsInfoService.add(goodsInfo);
    }

3, Core database

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for address_info
-- ----------------------------
DROP TABLE IF EXISTS `address_info`;
CREATE TABLE `address_info`  (
  `id` bigint(19) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Primary key id',
  `person_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'full name',
  `phone` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'Telephone',
  `gender` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Gender',
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'address',
  `user_id` bigint(19) NOT NULL COMMENT 'user',
  `is_deleted` char(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT 'Delete',
  `gmt_create` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'Creation time',
  `gmt_update` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'Update time',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'Receiving address information' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of address_info
-- ----------------------------
INSERT INTO `address_info` VALUES (1, 'zhy', '18034272031', '2', 'Hengshui City, Hebei Province', 1, '0', '2021-09-08 14:39:49', '2021-09-08 15:37:20');
INSERT INTO `address_info` VALUES (2, 'Zhang Hongyu', '18034272031', '2', '3008 Fuer building opposite CCTV building, Haidian District, Beijing', 1, '0', '2021-09-08 15:21:00', '2021-09-08 15:37:00');

-- ----------------------------
-- Table structure for blind_box_info
-- ----------------------------
DROP TABLE IF EXISTS `blind_box_info`;
CREATE TABLE `blind_box_info`  (
  `id` bigint(19) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Primary key id',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'title',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'describe',
  `price` bigint(19) NOT NULL COMMENT 'Unit Price',
  `sort` int(9) NOT NULL COMMENT 'sort',
  `is_on_sale` char(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT 'Is it on the shelf',
  `goods_level` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'probability',
  `is_deleted` char(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT 'Delete',
  `gmt_create` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'Creation time',
  `gmt_update` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'Update time',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'Blind box information' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of blind_box_info
-- ----------------------------
INSERT INTO `blind_box_info` VALUES (1, 'Optimus Prime Reloaded', 'Transformer transformation "Kaka, Kaka, KaKa"', 1, 0, '1', '{\"id\":1,\"level1\":25,\"level2\":25,\"level3\":25,\"level4\":25}', '0', '2021-09-02 17:21:15', '2021-09-19 13:30:47');
INSERT INTO `blind_box_info` VALUES (2, 'Apple iPhone Pure enjoyment', 'Apple mobile notebook tablet host headset', 1, 0, '1', '{\"id\":2,\"level1\":0.01,\"level2\":0.01,\"level3\":0.01,\"level4\":99.97}', '0', '2021-09-02 17:35:39', '2021-09-19 13:30:48');
INSERT INTO `blind_box_info` VALUES (3, 'Burn life! Your possibilities are infinite and omnipotent', 'New real bone carving!', 11, 1, '1', '{\"id\":3,\"level1\":0.01,\"level2\":0.02,\"level3\":0.03,\"level4\":99.94}', '0', '2021-09-02 17:53:36', '2021-09-12 21:44:13');
INSERT INTO `blind_box_info` VALUES (4, '111', '111', 1100, 1, '1', '{\"id\":null,\"level1\":25,\"level2\":25,\"level3\":25,\"level4\":25}', '0', '2021-09-19 13:32:10', '2021-09-19 13:32:27');

-- ----------------------------
-- Table structure for file_upload_info
-- ----------------------------
DROP TABLE IF EXISTS `file_upload_info`;
CREATE TABLE `file_upload_info`  (
  `id` bigint(19) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Primary key id',
  `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'route',
  `file_size` bigint(19) NULL DEFAULT NULL COMMENT 'size',
  `data_from` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'source',
  `is_deleted` char(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT 'Delete',
  `gmt_create` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'Creation time',
  `gmt_update` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT 'Update time',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 102 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'File upload information' ROW_FORMAT = Dynamic;

-- ----------------------------

4, Market positioning:

What is the biggest market?

The elderly should be healthy, women should be beautiful, and men should make money!

The target customers are women. The products are cosmetic products and high-end cosmetic products.

 

My wife often uses cosmetics. She went to a certain place to search. A small bottle of make-up water is the money for a pair of sneakers. I love it very much. nnd, I have worn a pair of sneakers for 7 years. I saw it split.

More than 100 million a month.

The customer's choice of the market is absolutely no problem, and the game is very fun. I used to play CF's lucky draw. I don't know how many rounds I played.

So the customer told me that they had to raise 2000w in the first round. If it happened, there would be a play.

The market for cosmetics is too big.

By the way, if you want to ask me for development, I want to declare the following:

We're not interested in the market at all. We're just developing! So you ask me to develop, I don't join your partnership, I just develop, and I don't have to draw cakes for me. Just give me the cost of development.

To put it bluntly, I just want to develop it for free. Every once in a while, someone always gives me picture cakes. I'm sorry, I have a bad stomach recently and can't digest big cakes.

But entrepreneurship is risky. I took a lot of development work in front of me. Among the many entrepreneurial products, only one person succeeded.

A Chinese dating website for an international student.

When the weather, geography and people were right, it suddenly became popular, and the annual profit reached 500w.

Most of the other 99% developed products are gg.

The idea of some products is very good and the market is also very good, but the promotion needs a great cost. Ordinary people can't afford to play.

The worst boss, we developed a labor market APP for him, and the market is huge. The boss smashed 300w promotion fee hopefully, and the development fee smashed 20w for us.

Unfortunately, all the money was lost in the end.

Finally, the reasons for the investigation for a long time, so that the boss is very depressed:

Migrant workers generally don't like to use app s. If the process used is complex, it will not be used. And promotion requires constant money.

The boss sprayed blood directly

5, Xiao Meng suggested:

With a good idea, we can develop it, but

Successful products need luck, capital injection and rapid occupation.

Ali tiktok has also done social software, and Tencent has also done an electronic shopping mall.

A successful product needs the right time, the right place and the right people.

In general, the product is hard enough. Only when it is put on the market and let the user experience is the king. As for other idea s, sometimes it's bullshit.

I'm Xiao Meng, sharing all kinds of project experience and interview materials.

Let's make progress together.

Ask for three company, praise, collection and more dry goods update ing:  

 

If you also want to learn the development of small programs, I recorded a detailed tutorial, which you can get below. Reply: applet actual combat

👇🏻   Tutorials are available by searching below   official account   obtain 👇🏻

 

Posted by moose4204l on Wed, 13 Oct 2021 13:49:23 -0700