{"id":19041555,"url":"https://github.com/xaxys/maintainman","last_synced_at":"2025-04-23T21:44:58.972Z","repository":{"id":41875752,"uuid":"471007296","full_name":"xaxys/MaintainMan","owner":"xaxys","description":"A golang logistic report management system powered by iris.","archived":false,"fork":false,"pushed_at":"2024-03-13T23:08:00.000Z","size":44781,"stargazers_count":9,"open_issues_count":7,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T21:44:44.458Z","etag":null,"topics":["back-end","backend","cms","cms-backend","dlut","dut","go","golang","iris","management-system","web"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xaxys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-17T13:30:54.000Z","updated_at":"2023-12-04T03:10:50.000Z","dependencies_parsed_at":"2022-08-11T20:00:37.772Z","dependency_job_id":"1ae55dcd-6540-4c18-8144-7724f45f5070","html_url":"https://github.com/xaxys/MaintainMan","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xaxys%2FMaintainMan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xaxys%2FMaintainMan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xaxys%2FMaintainMan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xaxys%2FMaintainMan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xaxys","download_url":"https://codeload.github.com/xaxys/MaintainMan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250522292,"owners_count":21444509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["back-end","backend","cms","cms-backend","dlut","dut","go","golang","iris","management-system","web"],"created_at":"2024-11-08T22:29:49.880Z","updated_at":"2025-04-23T21:44:58.943Z","avatar_url":"https://github.com/xaxys.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MaintainMan\n\n[![OurEDA 2022](https://img.shields.io/badge/OurEDA-2022-00ffcc.svg)](https://img.shields.io/badge/OurEDA-2022-00ffcc)\n[![License](https://img.shields.io/badge/license-MIT%20with%20PATENTS-green.svg)](https://github.com/xaxys/MaintainMan/blob/master/LICENSE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/xaxys/MaintainMan/pulls)\n[![Contributors](https://img.shields.io/github/contributors/xaxys/maintainman.svg)](https://github.com/xaxys/MaintainMan/graphs/contributors)\n[![Go Version](https://img.shields.io/github/go-mod/go-version/xaxys/maintainman.svg)](https://github.com/xaxys/MaintainMan/blob/master/go.mod)\n[![Release](https://img.shields.io/github/v/release/xaxys/maintainman.svg)](https://github.com/xaxys/MaintainMan/releases)\n[![Downloads](https://img.shields.io/github/downloads/xaxys/maintainman/total.svg)](https://github.com/xaxys/MaintainMan/releases)\n[![Build and Test](https://github.com/xaxys/MaintainMan/actions/workflows/main.yml/badge.svg)](https://github.com/xaxys/MaintainMan/actions/workflows/main.yml)\n\nMaintainMan is a logistic report management system powered by iris.\n\n## Feature\n\n- RESTful HTTP API\n\n- User management with configurable Role-Based access control\n\n- Database: Mysql, Sqlite3\n\n- Storage: S3, Local\n\n- Cache: Redis, Local\n\n- 3 pulggable modules\n\n  - Order management\n\n    - 8 status available\n\n      - Waiting for Assignment\n\n      - Order Assigned\n\n      - Order Completed\n\n      - Order Appraised\n\n      - Reported as pending\n\n      - Hold for a while\n\n      - Order Canceled\n\n      - Order Rejected\n\n    - Switchable order comment\n\n    - Order assignment system\n\n      - One Repairer for one assignment\n\n      - Supports multiple order assignments\n\n    - Order appraising system and performance display\n\n    - Item inventory management associated with the order system\n\n  - Announcement management\n  \n    - Configurable display times\n\n    - User click statistics\n\n  - Image Hosting service\n  \n    - Auto watermarking\n\n    - Custom transformation\n\n      - Resizing \u0026 Croping\n\n      - Text with color and font\n\n    - Image compression\n\n    - Configurable image cache\n\n- More...\n\n## Configuration\n\nMaintainMan has 6 configuration files now. All configuration files have independent version control.\n\nWhen the maintainman detected a old version configuration file, it will automatically upgrade it (conflict field will be skipped).\n\nWhen the maintainman detected a new version configuration file, it will send a warning message.\n\n### app.yml\n\nApp config is used to configure the database and various connection parameters as well as the functional parameters of the core system.\n\n\u003cdetails\u003e\n\u003csummary\u003eexample\u003c/summary\u003e\n\n```yaml\napp:\n  # application name.\n  name: \"maintainman\"\n  # listen port.\n  listen: \":8080\"\n  # log level (debug, info, warn, error, fatal).\n  loglevel: \"debug\"\n\n  page:\n    # max number of items in a page.\n    # http request paramenter `limit` must not exceed this value.\n    limit: 100\n    # default number of items in a page.\n    # this number will be used when http request paramenter `limit`\n    # is not specified or \u003c= 0.\n    default: 50\n\ntoken:\n  # token secret.\n  # IMPORTANT! you'd better change it to a random string or a strong\n  # secret key.\n  key: \"\"\n  # token expire duration.\n  expire: \"30m\"\n\ndatabase:\n  # database type (mysql, sqlite).\n  driver: \"mysql\"\n  mysql:\n    host: \"localhost\"\n    port: 3306\n    name: \"maintainman\"\n    params: \"parseTime=true\u0026loc=Local\u0026charset=utf8mb4\"\n    user: \"root\"\n    password: \"\"\n  sqlite:\n    # sqlite database file path.\n    path: \"maintainman.db\"\n\nstorage:\n  # storage type (local, s3).\n  driver: \"local\"\n  local:\n    path: \"./files\"\n  # if s3 connection defined here, module config without s3 connection\n  # will use the connection defined here.\n  s3:\n    access_key: \"\"\n    secret_key: \"\"\n    bucket: \"\"\n    region: \"\"\n\ncache:\n  # cache type (local, redis).\n  driver: \"local\"\n  # cache limit. if the cache limit is reached, some entries will be\n  # evicted automatically.\n  # if the cache limit is 0, no entries will not be evicted.\n  limit: 268435456 # 256M\n  redis:\n    host: \"localhost\"\n    port: 6379\n    password: \"\"\n\nthrottling:\n  enable: false\n  # the max number of requests allowed in a period.\n  burst: 100\n  # the duration between requests.\n  rate: 10\n  # the purge duration.\n  purge: 1m\n  # the expiration duration.\n  expire: 10m\n\n# enabled modules\nmodule:\n  role: true\n  user: true\n  image: true\n  announce: true\n  order: true\n  wxnotify: true\n  word: true\n  sysinfo: true\n\n# channel size of event bus (message bus).\nbus_buffer: 1000\n\n```\n\n\u003c/details\u003e\n\n### user.yml\n\nUser config is used to configure login and user management options.\n\n\u003cdetails\u003e\n\u003csummary\u003eexample\u003c/summary\u003e\n\n```yaml\nwechat:\n  # wechat appid.\n  appid: \"\"\n  # wechat secret.\n  secret: \"\"\n  # whether a unregistered user will be registered on wechat login.\n  # if false, reponse code will be `403` when a unregistered user try\n  # wechat login.\n  # if true, a unregistered user will be registered on wechat login.\n  # username will be open_id and user will be assigned a random password.\n  fastlogin: true\n\ncache:\n  # cache type (local, redis).\n  driver: local\n  # cache limit.\n  limit: 268435456 # 256M\n  # if redis, connection has been configured in app.yml\n\n# the admin user configuration.\n# only apply at first initialization.\n# IMPORTANT! you'd better change it to some strong password and delete\n# belowing entries after the first initialization.\nadmin:\n  name: \"admin\"\n  display_name: \"maintainman default admin\"\n  role_name: \"super_admin\"\n  password: \"12345678\"\n\n```\n\n\u003c/details\u003e\n\n### role.yml\n\nRole config is used to configure all roles and their corresponding permissions. Roles are ordered. Only buttom-up inheritance is valid (latter roles are superior).\n\n\u003cdetails\u003e\n\u003csummary\u003eexample\u003c/summary\u003e\n\n```yaml\nrole:\n\n- display_name: 封停用户\n  name: banned\n  permissions: []\n  inheritance: []\n\n- name: guest\n  display_name: 访客\n  guest: true\n  permissions:\n  - user.register\n  - user.login\n  - user.wxlogin\n  - user.wxregister\n  inheritance: []\n\n- name: user\n  display_name: 普通用户\n  default: true\n  permissions:\n  - image.upload\n  - image.view\n  - user.view\n  - user.update\n  - user.renew\n  - role.view\n  - announce.view\n  - announce.hit\n  - order.view\n  - order.create\n  - order.cancel\n  - order.update\n  - order.appraise\n  - order.urgence\n  - order.comment.view\n  - order.comment.create\n  - order.comment.delete\n  - tag.view.1\n  - tag.add.1\n  # `tag.add.1` is a special permission.\n  # in `perm.?` pattern, if `?` is a number, the number will be compared\n  # to judge whether the role has the permission.\n  # e.g. if a role has `perm.2`, then the `perm.2` and `perm.1` will be\n  # judge as true.\n  inheritance:\n  - guest\n\n- name: maintainer\n  display_name: 维护工\n  permissions:\n  - order.viewfix\n  - order.reject\n  - order.report\n  - order.complete\n  - item.consume\n  - item.viewall\n  - tag.view.2\n  - tag.add.2\n  inheritance:\n  - user\n\n- name: super_maintainer\n  display_name: 维护工（可自行接单）\n  permissions:\n  - order.selfassign\n  - order.viewall\n  inheritance:\n  - maintainer\n\n- name: admin\n  display_name: 管理员\n  permissions:\n  - image.*\n  - division.*\n  - announce.*\n  - order.*\n  - tag.*\n  - item.*\n  # in `perm.*` pattern, `*` means any, all sub permissions under perm will\n  # be judged as true.\n  inheritance:\n  - maintainer\n\n- name: super_admin\n  display_name: 超级管理员\n  permissions:\n  - '*'\n  inheritance:\n  - admin\n\n```\n\n\u003c/details\u003e\n\n### image.yml\n\nImage config is used to configure image hosting service and predefined transformations.\n\n\u003cdetails\u003e\n\u003csummary\u003eexample\u003c/summary\u003e\n\n```yaml\n# jpeg compression quality.\njpeg_quality: 80\n# max gif color number.\ngif_num_colors: 256\n# all image after transformation will be cached as jpeg.\ncache_as_jpeg: true\n# all image uploaded will be saved as gif.\nsave_as_jpeg: false\n\nupload:\n  # upload request returns straight after image is processed by the server.\n  # but saving might still fail.\n  async: false\n  # the max file size of image allowed to upload.\n  max_file_size: 10485760 # 10 MB\n  # the max dimension of image allowed to upload.\n  max_pixels: 15000000    # 15 million pixels\n  # the throttling rate control.\n  throttling:\n    enable: true\n    # the max number of requests allowed in a period.\n    burst: 20\n    # the duration between requests.\n    rate: 5\n    # the purge duration.\n    purge: 1m\n    # the expiration duration.\n    expire: 5m\n\ncache:\n  # cache type (local, redis).\n  driver: local\n  # cache limit. if the cache limit is reached, image in storage\n  # will be deteted automatically.\n  # if the cache limit is 0, no entries will not be evicted.\n  # (strongly not recommended)\n  limit: 1073741824 # 1 GB\n  # if redis, connection has been configured in app.yml\n\nstorage:\n  # storage type (local, s3).\n  driver: local\n  local:\n    path: ./images\n  s3:\n    # if access_key and secret_key are not set, s3 connection defined\n    # in app.yml will be used.\n    # access_key: \"\"\n    # secret_key: \"\"\n    # region: \"\"\n    bucket: \"Image\"\n  # image cache storage. sub path of main storage.\n  # e.g. if main storage is ./images, cache storage is ./images/cache,\n  cache:\n    # whether the storage path will be cleaned up on server start.\n    # recommended to be true if you are using local cache instead of redis.\n    clean: true\n\ntransformations:\n  # predefined transformations.\n  # square returns a 256 x 256 square image chopped from the center.\n  square:\n    params:   w_256,h_256,c_p,g_c\n    # Run on every upload\n    eager:   true\n  # watermarked returns a equal scaling, 800 widthm, watermarked image.\n  watermarked:\n    # if params is not set, the transformation will be applied on.\n    default: true\n    params: w_800\n    texts:\n    # text will be added to the bottom right corner of the image.\n    # the {{.Name}} will be replaced by the upload user name.\n    - content: \"{{.Name}}@MaintainMan\"\n      gravity: se\n      # text position in the image. relative to gravity.\n      # non-negative integer.\n      x-pos:   10\n      y-pos:   0\n      # color format is hex.\n      # e.g. #RRGGBBAA or #RRGGBB or #RGBA or #RGB\n      color:   \"#808080CC\"\n      # font file path. if not set, will search filename in\n      # embedded fonts.\n      font:    fonts/SourceHanSans-Regular.ttf\n      size:    14\n\n```\n\n\u003c/details\u003e\n\n### announce.yml\n\nAnnounce config is used to configure announcement management.\n\n\u003cdetails\u003e\n\u003csummary\u003eexample\u003c/summary\u003e\n\n```yaml\n# the duration that a user hit the same announcement will not\n# be counted repeatedly.\nhit_expire: \"12h\"\n\ncache:\n  driver: \"local\"\n  limit: 268435456 # 256M\n\n```\n\n\u003c/details\u003e\n\n### order.yml\n\nOrder config is used to configure order management.\n\n\u003cdetails\u003e\n\u003csummary\u003eexample\u003c/summary\u003e\n\n```yaml\n# Whether item count can be negative.\n# if false, an `item count is not enough` error may be returned on\n# item consuming.\nitem_can_negative: true\n\nappraise:\n  # the duration that a user can appraise the order after the\n  # order completed.\n  # the order will be appraised automatically after the duration.\n  timeout: \"72h\"\n  # the duration that the system will check the timeouted unappraised order.\n  purge: \"10m\"\n  # the default appraise score of timeouted unappraised order.\n  default: 5\n\nnotify:\n  wechat:\n    status:\n      tmpl:   \"微信订阅消息模板id\"\n      order:  \"模板中 订单编号 字段名\"\n      title:  \"模板中 订单标题 字段名\"\n      status: \"模板中 订单状态 字段名\"\n      time:   \"模板中 订单更新时间 字段名\"\n      other:  \"模板中 备注 字段名 (用于传递维修工信息)\"\n\n    comment:\n      tmpl:    \"微信留言消息模板id\"\n      title:   \"模板中 订单标题 字段名\"\n      name:    \"模板中 留言人 字段名\"\n      messgae: \"模板中 留言内容 字段名\"\n      time:    \"模板中 留言时间 字段名\"\n\n```\n\n\u003c/details\u003e\n\n## Documentation\n\nFind document here [Maintainman Doc](https://maintainman.oasis.run/).\n\nOr On [Github Wiki](https://github.com/xaxys/MaintainMan/wiki/API-Docs).\n\n## Contributing\n\nYou can help to make the project better by creating an issue or pull request.\n\n## Author\n\n- xaxys\n\n  - [github.com/xaxys](https://github.com/xaxys)\n\n  - [alappm@qq.com](mailto:alappm@qq.com)\n\n- Marksagittarius\n\n  - [github.com/Marksagittarius](https://github.com/Marksagittarius)\n\n- DawningW\n\n  - [github.com/DawningW](https://github.com/DawningW)\n\n## License\n\nReleased under [MIT License](https://github.com/xaxys/MaintainMan/blob/master/LICENSE). We also provide an additional [patent grant](https://github.com/xaxys/MaintainMan/blob/master/PATENTS).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxaxys%2Fmaintainman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxaxys%2Fmaintainman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxaxys%2Fmaintainman/lists"}