当前位置:网站首页>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 !
边栏推荐
- Community ownership of NFT trading market is unstoppable
- Calculate the sum of the main diagonals of the array
- Wechat app mall, review products, upload commodity pictures, and score Commodity Services
- C language -- legal identifier and integer
- In those years, interview the abused red and black trees
- [latex bearer] use tables in \title (error \begin doesn't match its definition.)
- JS tutorial - printing stickers / labels using the electronjs desktop application
- 电路中缓存的几种形式
- 知道这几个命令让你掌握Shell自带工具
- Byte interview: two array interview questions, please accept
猜你喜欢
Scala Basics (II): variables and data types

Interpretation of cloud native microservice technology trend

Apache APIs IX has the risk of rewriting the x-real-ip header (cve-2022-24112)

Basic requirements: 7 problems in singleton mode

构造函数和析构函数

Vibrating liquid quantity detecting device

Teach you to learn dapr - 2 Must know concept
![[Li Kou brush question] monotone stack: 84 The largest rectangle in the histogram](/img/75/440e515c82b5613b117728ba760786.png)
[Li Kou brush question] monotone stack: 84 The largest rectangle in the histogram

经典同步问题

Stm32h7b0 replaces the h750 program, causing the MCU to hang up and unable to burn the program
随机推荐
基於Kubebuilder開發Operator(入門使用)
[机缘参悟-31]:鬼谷子-抵巇[xī]篇-危机是危险与机会并存
[from database deletion to running] JDBC conclusion (finish the series in one day!! run as soon as you finish learning!)
Teach you to learn dapr - 1 The era of net developers
What is flush software? Is it safe to open an account online?
Deployment and operation of mongodb partitioned cluster
Science | 红树林中发现的巨型细菌挑战传统无核膜观念
20:第三章:开发通行证服务:3:在程序中,打通redis服务器;(仅仅是打通redis服务器,不涉及具体的业务开发)
QT 5.9.8 installation tutorial
Web3 decentralized storage ecological landscape
Pybullet robot simulation environment construction 5 Robot pose visualization
Day10 daily 3 questions (2): count the number of the largest groups
LeetCode Algorithm 24. 两两交换链表中的节点
Stm32h7b0 replaces the h750 program, causing the MCU to hang up and unable to burn the program
Some explanations for latex CJK
Qt 5.9.8 安装教程
[understanding of opportunity -31]: Guiguzi - Daoyu [x ī] Crisis is the coexistence of danger and opportunity
y=1/100*100+1/200*200+1/300*300+.....+ 1/m*m
Don't believe it, 98% of programmers are like this
电路中缓存的几种形式