“This is my 23rd day of participating in the First Challenge 2022. For details: First Challenge 2022

I. Introduction:

With the rapid development of society, the influence of computer is comprehensive and deep. With the continuous improvement of people’s living standards, users’ requirements on running peripheral shopping malls in daily life are also increasing, and marvel series peripheral shopping malls are favored by the majority of users, making the development of Marvel series peripheral shopping malls a necessary and urgent matter. With the help of computers, the marvel series hand-operated peripheral mall can increase users’ choices through the information management required by the Marvel series hand-operated peripheral mall, and also facilitate the timely query, modification and understanding of users’ information. Hand-run peripheral shopping mall has brought more convenience to users, the system through and database management system software cooperation to meet the needs of users. The application of computer technology in modern management makes computer become an important tool for people to apply modern technology. It can effectively solve the problem of convenient and comprehensive access to information and improve efficiency.

Ii. Functional Design:

The main function of the Marvel series manual peripheral mall system is designed to realize the administrator; Personal center, system announcement management, user management, commodity series management, commodity information management, order evaluation management, forum management, system management, order management, users; Personal center, order evaluation management, my collection management, order management, front page; Home page, product information, forum information, my, jump to the background, shopping cart customer service and other information management functions. The system operation flow is as follows:

Iii. Function Screenshots:

Common user login registration:

Home page main functions: product information, forum information, my, jump to the background, shopping cart customer service and other information management functions

Product details: add to shopping cart, modify quantity, buy and collect goods immediately

Product details can be configured with text and text introduction

Product review communication module

Added a series of forum post functions: ordinary users can publish, can communicate and discuss the post, etc

Post details data view, you can comment at the bottom

In my personal center you can view my posts, my orders, my address changes, my favorites module and my personal information module

Shopping cart module: to select the delivery address information

My order module:

My favorite module:

Background center for common users:

Order evaluation:

Collection Management:

Order information Management:

Back-end administrator main functions:

Change password:

User management:

 Product Series Management:

Commodity Information Management:

Modification of product details:

Commodity evaluation management:

Forum Management:

Customer Service Management:

Home page Rotation map management:

Order information Management:

Five, the key code:


/** * Login related */
@RequestMapping("users")
@RestController
public class UserController{
	
	@Autowired
	private UserService userService;
	
	@Autowired
	private TokenService tokenService;

	/** * login */
	@IgnoreAuth
//	@PostMapping(value = "/login")
	@RequestMapping(value = "/login", method ={RequestMethod.GET,RequestMethod.POST} )
	public R login(String username, String password, String captcha, HttpServletRequest request) {
		UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
		if(user==null| |! user.getPassword().equals(password)) {return R.error("Incorrect account number or password");
		}
		String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
		return R.ok().put("token", token);
	}
	
	/** * Register */
	@IgnoreAuth
	@PostMapping(value = "/register")
	public R register(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
    	if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) ! =null) {
    		return R.error("User already exists");
    	}
        userService.insert(user);
        return R.ok();
    }

	/** * exit */
	@GetMapping(value = "logout")
	public R logout(HttpServletRequest request) {
		request.getSession().invalidate();
		return R.ok("Exit successful");
	}
	
	/**
     * 密码重置
     */
    @IgnoreAuth
	@RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request){
    	UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
    	if(user==null) {
    		return R.error("Account does not exist");
    	}
    	user.setPassword("123456");
        userService.update(user,null);
        return R.ok("Password reset to 123456");
    }
	
	/** * list */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,UserEntity user){
        EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
    	PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
        return R.ok().put("data", page);
    }

	/** * list */
    @RequestMapping("/list")
    public R list( UserEntity user){
       	EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
      	ew.allEq(MPUtil.allEQMapPre( user, "user")); 
        return R.ok().put("data", userService.selectListView(ew));
    }

    /** * info */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /** * Get user session user information */
    @RequestMapping("/session")
    public R getCurrUser(HttpServletRequest request){
    	Long id = (Long)request.getSession().getAttribute("userId");
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }

    /** * save */
    @PostMapping("/save")
    public R save(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
    	if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) ! =null) {
    		return R.error("User already exists");
    	}
        userService.insert(user);
        return R.ok();
    }

    /** * modify */
    @RequestMapping("/update")
    public R update(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
        userService.updateById(user);// All updates
        return R.ok();
    }

    /** * delete */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        userService.deleteBatchIds(Arrays.asList(ids));
        returnR.ok(); }}Copy the code

      
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">

    <! -- Configure data source -->
    <bean name="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
        <property name="url" value="${jdbc_url}"/>
        <property name="username" value="${jdbc_username}"/>
        <property name="password" value="${jdbc_password}"/>

        <! -- Initialize connection size -->
        <property name="initialSize" value="0"/>
        <! -- Maximum number of connections in the pool -->
        <property name="maxActive" value="20"/>
        <! -- Connection pool maximum free time -->
        <property name="maxIdle" value="20"/>
        <! -- Connection pool minimum idle -->
        <property name="minIdle" value="0"/>
        <! Get the maximum waiting time for connections -->
        <property name="maxWait" value="60000"/>

        <property name="validationQuery" value="${validationQuery}"/>
        <property name="testOnBorrow" value="false"/>
        <property name="testOnReturn" value="false"/>
        <property name="testWhileIdle" value="true"/>

        <! -- How often is it configured to detect idle connections that need to be closed in milliseconds -->
        <property name="timeBetweenEvictionRunsMillis" value="60000"/>
        <! Set the minimum time for a connection to live in the pool, in milliseconds.
        <property name="minEvictableIdleTimeMillis" value="25200000"/>

        <! -- Enable removeAbandoned -->
        <property name="removeAbandoned" value="true"/>
        <! 1800 seconds, or 30 minutes -->
        <property name="removeAbandonedTimeout" value="1800"/>
        <! An error log was generated when abanded connection was closed -->
        <property name="logAbandoned" value="true"/>

        <! -- Monitor database -->
        <property name="filters" value="mergeStat"/>
    </bean>

    <! Spring integration with Mybatis: http://mp.baomidou.com
    <bean id="sqlSessionFactory" class="com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <! -- Automatically scan mapping.xml file -->
        <property name="mapperLocations" value="classpath:mapper/*.xml"/>
        <property name="configLocation" value="classpath:mybatis/mybatis-config.xml"/>
        <property name="typeAliasesPackage" value="com.. model.*"/>
        <property name="typeEnumsPackage" value="com.model.enums"/>
        <property name="plugins">
            <array>
                <! -- Paging plug-in configuration -->
                <bean id="paginationInterceptor" class="com.baomidou.mybatisplus.plugins.PaginationInterceptor">
                </bean>
            </array>
        </property>
	    <! -- Global Configuration injection -->
	    <property name="globalConfig" ref="globalConfig" />
	</bean>
	<bean id="globalConfig" class="com.baomidou.mybatisplus.entity.GlobalConfiguration">
	    <! - AUTO - > ` 0 ` (" database ID on the "INPUT - > ` ` 1 (INPUT from the user ID") ID_WORKER - > 2 ` ` UUID (" globally unique ID) - > ` 3 ` (" globally unique ID ") -- - >
	    <property name="idType" value="2" />
		<! -- MYSQL->`mysql` ORACLE->`oracle` DB2->`db2` H2->`h2` HSQL->`hsql` SQLITE->`sqlite` POSTGRE->`postgresql` SQLSERVER2005->`sqlserver2005` SQLSERVER->`sqlserver` -->
		<! Oracle needs to add this item -->
	    <! -- <property name="dbType" value="oracle" /> -->
	    <! -- Set global table name to underscore true -->
	    <! -- <property name="dbColumnUnderline" value="true" /> -->
        <property name="metaObjectHandler">
            <bean class="com.config.MyMetaObjectHandler" />
        </property>
	</bean>

    <! MyBatis Dynamic Scan -->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <property name="basePackage" value="com.dao"/>
    </bean>

    <! -- Configure transaction management -->
    <bean name="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>

    <! -- Transaction management Properties -->
    <tx:advice id="transactionAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <tx:method name="add*" propagation="REQUIRED"/>
            <tx:method name="append*" propagation="REQUIRED"/>
            <tx:method name="save*" propagation="REQUIRED"/>
            <tx:method name="update*" propagation="REQUIRED"/>
            <tx:method name="modify*" propagation="REQUIRED"/>
            <tx:method name="edit*" propagation="REQUIRED"/>
            <tx:method name="insert*" propagation="REQUIRED"/>
            <tx:method name="delete*" propagation="REQUIRED"/>
            <tx:method name="remove*" propagation="REQUIRED"/>
            <tx:method name="repair" propagation="REQUIRED"/>

            <tx:method name="get*" propagation="REQUIRED" read-only="true"/>
            <tx:method name="find*" propagation="REQUIRED" read-only="true"/>
            <tx:method name="load*" propagation="REQUIRED" read-only="true"/>
            <tx:method name="search*" propagation="REQUIRED" read-only="true"/>
            <tx:method name="datagrid*" propagation="REQUIRED" read-only="true"/>

            <tx:method name="*" propagation="REQUIRED"/>
        </tx:attributes>
    </tx:advice>

    <! -- Configuration section -->
    <aop:config>
        <aop:pointcut id="transactionPointcut" expression="execution(* com.service.. *. * (..) )"/>
        <aop:advisor pointcut-ref="transactionPointcut" advice-ref="transactionAdvice"/>
    </aop:config>

</beans>

Copy the code

Thesis Report:

Thesis Report:

At this point, the project has been completed. Even if the implementation time is not very long, it needs to prepare for a long period of time to learn the actual technology of the system design and development. In the process of learning, I gradually realized some of my own shortcomings. For some control is necessary application skills, to be able to understand that the whole process is just a master of common performance and control methods, I feel quite easy. From the system, the system analysis and design of survey data, and has been experienced for several months, and efforts for several months, the system has been completed. Obviously, the system still has a lot of immature, there are many technical defects in the system design process. In the process of design, I also involved in many problems that I could not solve. I mainly solved these problems by looking for professional websites and forums. They also contributed a lot to the successful completion of my graduation design. System development environment and the configuration can be installed on its own, the system USES the JSP development tools, the use of more mature Mysql database on the system at the front desk and the background of data interaction, database according to the technical language, and combining with the demand for modified maintenance, can make the system run more stability and security, so as to complete the implementation of system development.

Get the source code:

Clocked articles updated 201/365 days

You can like, collect, pay attention to, comment on me, there is a need to complete the source and I contact yo ~!