跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[程序员] 关于后台数据库结构和业务逻辑的一点疑惑,求指导

发表于

我之前主要做移动端,最近尝试着自己学习和写后端业务,但在构思的过程中遇到一些疑惑,想知道这类问题的普遍做法应该是什么样的,求指导。 疑惑 1:假设用户有角色,角色是一张表,由管理员增删改,用户是一张表,有角色 id ,当管理员修改了甚至删除了某个角色,用户的角色应该怎么处理呢。我能想到的可能操作,1 是制定一个默认角色,被删除角色的用户都变成这个默认角色; 2 是逻辑里判断只要有用户在使用这个角色,就不能删除。哪种更常用呢?

疑惑 2:与疑惑 1 类似但感觉更复杂,比如有任务模板表,每个模板都有一系列子任务;然后有一个任务表,每个任务都是从任务模板对应的,具体的任务必须要按照任务模板的子任务逐个执行;那么,任务模板的删改操作,应该怎么维护呢。假设有脱胎自某个模板的任务正在执行中,此时修改甚至删除了部分模板的子任务,那么当前这个任务的执行逻辑怎么保证呢?

求指导,真心~

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.