当前位置:网站首页>Platform management background and merchant menu resource management: merchant registration management design
Platform management background and merchant menu resource management: merchant registration management design
2022-06-26 16:58:00 【Seconds to write code】
Business registration management design
The design of business registration management is mainly through calling business services REST API Realized .
When you sign up for a business , In addition to creating a merchant object , You also have to create a user for the business , In this way, businesses can use this user to log in to the business management background .
Add two fields to the query object design of the merchant , It is used to indicate the brief information of the user to whom the merchant belongs , The code is as follows :
public class MerchantQo extends PageQo implements Serializable {
private Long id;
private String name;private String email;private String phone;private String address;private String linkman; DateTimeFormat(
pattern ="yyyy-MM-dd HH: mm:ss"
private Date created;
private String userName;private String password;
public MerchantQ0() {}
...
}among ,userName and l passWord They are used to represent the user name and password of the business user respectively .
So in the new business page design new.html in , You can use the form design shown below :
<form id="saveForm" action=" ./save" method="post">
<table class="addNewInfList">
<tr>
<th> name </th>
<td width-"240">
<input class="inp-list w-200 clear-mr f-left" type="text"
id="name" name= "name" maxlength="32"/>
<span class="tipstar f-left">*</span></td>
<th> mailbox </th>
<td width-"240">
<input class="inp-list w-200 clear-mr f-left" type="text"
id= "email" name= "email" maxlength="128"/>
</td>
</tr>
<tr>
<th> Telephone </th>
<td width-"240">
<input class="inp-list w-200 clear-mr f-left" type="text"
id="phone" name="phone" maxlength="32"/>
<span class="tipStar f-left">*</span></td>
<th> Address </th>
<td width="240">
<input class="inp-list w-200 clear-mr f-left" type="text"
id="address" name="address" maxlength="255" />
</td>
</tr>
<tr>
<th> Contacts </th><td width="240">
<input class="inp-list w-200 clear-mr f-left" type="text"
id="linkman" name="linkman" maxlength="128"/>
</td>
<th> date </th><td>
<input onfocus="wdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
type="text" class="inp-list w-200 clear-mr f-left" id="created"
name="created"/>
</td></tr>
<tr>
<th> user name </th><td width="240">
<input class="inp-list w-200 clear-mr f-left" type="text"
id="userName" name="userName" maxlength="128"/>
<span class="tipstar f-left">*</span></td>
<th> password </th>
<td width="240">
<input class="inp-list w-200 clear-mr f-left" type="password"
id="password" name="passWord" maxlength="32"/>
<span class="tipStar f-left">*</span></td>
</tr>
</table>
<div class="bottomBtnBox">
<a class="btn-93x38 saveBtn" href="javascript:void (0)"> determine </a>
<a class="btn-93x38 backBtn" href="javascript: closeDialog ()"> return </a></div>
</form>The user name and password of the merchant user can be filled in when the merchant is created . After finishing the design , Create the design effect of the merchant as shown in the figure 11-2 Shown .

When a new merchant submits a form , Through the controller to achieve business services MerchantRestService Make a remote call , And check whether the user name has been registered , The implementation code is as follows :
@Controller
@RequestMapping("/merchant")
public class MerchantController{
private static Logger logger = LoggerFactory.getLogger(MerchantController.class);
@Autowired
private MerchantRestService merchantRestService;cAutowired
private UserRestservice userRestService;
@RequestMapping (value="/save",method = RequestMethod.POST)@ResponseBody
public String save(MerchantQo merchantQo,HttpServletRequest request) throwsException{
String json = userRestService.findByName (merchantQo.getUserName ());UserQo userQo = new Gson().fromJson(json,UserQo.class);
if(userQo != null){
String str = " user name '" +merchantQo.getUserName() +"" Already exist , Please try again
Input !";
logger.info(str);return str;
}
String ret = merchantRestService.create (merchantQ0);logger.info(" newly added ="+ ret);
return ret;
}
}here , Using query objects directly MerchantQo Pass parameters , After receiving the request, the merchant service , Will create a merchant and a merchant user , And assign the administrator role to it by default .
The content of this article is platform management background and business menu resource management : Business registration management design
- The next article is to explain the platform management background and business menu resource management : Business permissions and menu resource management design ;
- Friends who think the article is good can forward this article and pay attention to Xiaobian ;
- Thank you for your support !
边栏推荐
- Research on natural transition dubbing processing scheme based on MATLAB
- MS | Xie Liwei group found that mixed probiotics and their metabolites could alleviate colitis
- C language -- legal identifier and integer
- Programmer's essential toolkit, please collect!
- 【MATLAB项目实战】基于卷积神经网络与双向长短时(CNN-LSTM)融合的锂离子电池剩余使用寿命预测
- Multiply the values of the upper triangular elements of the array by M
- [matlab project practice] prediction of remaining service life of lithium ion battery based on convolutional neural network and bidirectional long short time (cnn-lstm) fusion
- Several forms of buffer in circuit
- Junit单元测试
- Call the random function to generate 20 different integers and put them in the index group of institute a
猜你喜欢

GUI+SQLServer考试系统

r329(MAIX-II-A(M2A)资料汇总

Web3去中心化存储生态图景

Leetcode 1169. Query invalid transactions (if the amount of data is small, this problem still needs to be solved by violent enumeration)
Scala 基礎 (二):變量和數據類型

Deployment and operation of mongodb partitioned cluster
![[机缘参悟-31]:鬼谷子-抵巇[xī]篇-危机是危险与机会并存](/img/e8/9c5f1658a252c3c80503b5021917f6.jpg)
[机缘参悟-31]:鬼谷子-抵巇[xī]篇-危机是危险与机会并存

Vibrating liquid quantity detecting device

NFT 交易市场社区所有化势不可挡

In those years, interview the abused red and black trees
随机推荐
JS tutorial - printing stickers / labels using the electronjs desktop application
Classical synchronization problem
并发编程整体脉络
Over the weekend: 20000 words! Summary of JVM core knowledge, 18 serial cannons as a gift
知道这几个命令让你掌握Shell自带工具
Overall context of concurrent programming
Develop operator based on kubebuilder (for getting started)
Least squares system identification class II: recursive least squares
探讨:下一代稳定币
Junit单元测试
20: Chapter 3: develop the pass service: 3: get through the redis server in the program; (it only connects with the redis server and does not involve specific business development)
对NFT市场前景的7个看法
Sandboxed container: container or virtual machine
Science | giant bacteria found in mangroves challenge the traditional concept of nuclear free membrane
Discussion: the next generation of stable coins
C language -- legal identifier and integer
5g is not flat and 6G is restarted. China leads wireless communication. What is the biggest advantage of 6G?
Make up the weakness - Open Source im project openim about initialization / login / friend interface document introduction
Scala 基礎 (二):變量和數據類型
Redis 概述整理