Giter Club home page Giter Club logo

backend's People

Contributors

alvissreimu avatar chaosniku avatar chokhoou avatar cyj5230 avatar galvingao avatar kamil118 avatar saya-t avatar sqrpi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

backend's Issues

Account/Authorization Algorithm Optimization

What problem does this feature solve?

Users might forget or lose their userId for various reasons: unexpected cookie expiration, insufficient brain memory, etc.

What does the proposed API look like?

  • Users can authorize to their Penguin Statistics account by using their social media platform accounts, and the backend will be expected to authorize such platform through the OAuth2 algorithm.
  • Using tags to categorize user in different categories in order to provide full control on such account.

内部优化:错误信息报错统一化

目前企鹅的异常信息较为混乱,缺乏统一的管理。
如:

	public ResponseEntity<AdvancedQueryResponse> getAdvancedResultHelper(AdvancedQueryRequest advancedQueryRequest,
			HttpServletRequest request) {
                            // 省略
		advancedQueryRequest.getQueries().forEach(singleQuery -> {
			try {
		               // 省略
				BasicQueryResponse queryResponse = queryMapper.elementsToBasicQueryResponse(singleQuery, elements);
				results.add(queryResponse);
			} catch (TimeoutException toEx) {
				log.error("TimeoutException in executeAdvancedQueries: ", toEx);
			} catch (ExecutionException exeEx) {
				log.error("ExecutionException in executeAdvancedQueries: ", exeEx);
			} catch (Exception ex) {
				log.error("Error in executeAdvancedQueries: ", ex);
			}
		});
		AdvancedQueryResponse advancedQueryResponse = new AdvancedQueryResponse(results);
		return new ResponseEntity<AdvancedQueryResponse>(advancedQueryResponse, HttpStatus.OK);
	}

如上图代码。当查询结果超时时,queryMapper.elementsToBasicQueryResponse就会throw一个TimeoutException,而上图代码catch住该异常后,仅仅是log了一个error日志,再无其他操作。在该业务逻辑的最后,直接将emptyList返回给上层代码,最终返回给前端。
而实际上,当成功调用queryMapper.elementsToBasicQueryResponse时,其最终返回的结果中,是很有可能查询到数据的。
这对用户非常的不友好。

对于这种情况的代码,并不仅仅存在于某一处,在企鹅中也有其他类似的情况。

针对当前对异常的混乱处理,我将对企鹅中整体的异常体系进行重构,对异常进行统一化。

具体会在最上层异常分为两大类:

  1. ServiceException: 当前服务因为某些原因挂了,或者RPC超时,又或者是DB异常(锁, 超时)等等的一些源于系统内部的异常,将会使用此异常进行抛出。处理该异常时,我们将会统一给前端传 :“服务繁忙"的字眼。
	public ResponseEntity<AdvancedQueryResponse> getAdvancedResultHelper(AdvancedQueryRequest advancedQueryRequest,
			HttpServletRequest request) {
		// 省略
		advancedQueryRequest.getQueries().forEach(singleQuery -> {
			try {
				// 省略
				BasicQueryResponse queryResponse = queryMapper.elementsToBasicQueryResponse(singleQuery, elements);
				results.add(queryResponse);
			} catch (TimeoutException toEx) {
				// example
				throw new ServiceException("TimeoutException in executeAdvancedQueries.",toEx);
			} 
		});
		AdvancedQueryResponse advancedQueryResponse = new AdvancedQueryResponse(results);
		return new ResponseEntity<AdvancedQueryResponse>(advancedQueryResponse, HttpStatus.OK);
	}
  1. BusinessException: 当用户操作错误、数据库中查找不到数据、又或者某些参数不合法,等等的一些源于用户这边的错误,导致业务逻辑需要终止的异常,将会使用此异常进行抛出。在这个异常中,我们还会给出准确的tips返回给用户,以告知用户错误原因。

对于ServiceException,在内部中,我们会把详细的堆栈信息打印出来以便于开发人员以及运维定位问题。而对于BusinessException,我们仅需log简单的一些msg日志即可

Short Link and Link Share

What problem does this feature solve?

N/A

What does the proposed API look like?

Allow user to do a quick global query by:

  • exusi.ai/1-7
  • exusi.ai/us/1-7
  • exusi.ai/cn/石头

Also, we can generate short URL for some of our pages:

  • Results by stage (must contain /{server}/)
  • Results by item (must contain /{server}/)
  • Advanced query
  • Planner

汇报API加个uploader

我在试着写自动上传的东西 poi-statistics的数据收集是会收集上传的插件名称和版本号的 我觉得你们也可以整一个
之后无聊可以写写贡献排名x

数据修正请求

https://github.com/ninthDevilHAUNSTER/ArknightsAutoHelper 在实现 v2 API 掉落数量验证的过程中,错误地将活动掉落从最终提交列表中移除[1]

请考虑从自 2020 年 6 月至今(包括当前活动)的活动掉落样本中移除来自 ArknightsAutoHelper 的样本。

[1]: https://github.com/ninthDevilHAUNSTER/ArknightsAutoHelper/blob/18ac87a1c67d495aca385107978c4815ecc95936/penguin_stats/reporter.py#L140 ,由于 penguin-statistics/frontend-v2#175 ,活动掉落的数量由 ArknightsAutoHelper 自行验证,并通过一个 dirty hack 跳过使用 API 数据进行的验证。


另:修复过程中产生了

  • 36ec48da66107138d2bafff1710e807455005435846080c28a035730b1c7a7c1
  • 71a127e8798d1508a65aa382082eefe46f29ae54d530c2ab18cabd9283aca83d
  • 3b31ca263cbccfca6039d16650aed0bf5aad2ec3930118ac32c40ea8038ecc3d

等多个包含活动掉落的 report,但似乎没有反映在在前端中查询到的数量中,希望确认是否包含活动掉落

Add i18n for multiple fields in the api

What problem does this feature solve?

Currently the international servers (including US and JP servers) are nearly being opened to the public players, thus the need of having both the item and stage names being localized is increased, indicating us, as the developer of Penguin Statistics, shall improve the localization support on such languages.

What does the proposed API look like?

The backend will return localization string objects; an example can be:

{ "name": { "en": "Basic Combat Record", "zh": "基础作战记录", "ja": "基本的な戦闘記録" } }

PS: the translations are only for example: they might be wrong, so don't use them as the actual translation.

(error) [Ajax] failed Error: Request failed with status code 500

URL

https://penguin-stats.io/report/stage/act18d3_zone1/act18d3_09

What is actually happening?

2021-05-10 以及 2021-05-11 早上9点左右都会自动出现这个问题无法汇报掉落,本地网络正常。


(error) [Ajax] failed Error: Request failed with status code 500
exports https://penguin-stats.io/js/chunk-vendors.0856f51d.js:1
exports https://penguin-stats.io/js/chunk-vendors.0856f51d.js:7
onreadystatechange https://penguin-stats.io/js/chunk-vendors.0856f51d.js:34
r https://penguin-stats.io/js/chunk-vendors.0856f51d.js:7
chunk-vendors.0856f51d.js:7:429139
Rt https://penguin-stats.io/js/chunk-vendors.0856f51d.js:7
value https://penguin-stats.io/js/app.e10a9b45.js:1
value https://penguin-stats.io/js/app.e10a9b45.js:1
9efd https://penguin-stats.io/js/app.e10a9b45.js:1

关于“物品掉落分时查询”的问题

请问“物品掉落分时查询”这个功能实装以后,是否可以查询近三个月/近一个月等时间段内的掉落情况了?
(有些怀疑丫丁暗改掉率,但是好像企鹅物流目前的算法都是从开服时的数据一直滚到现在?)

Farming Strategy Planner shows incorrect syntheses suggestion

URL

https://penguin-stats.io/planner

Steps to reproduce

I used the following configuration in the planner:

{"@type":"@penguin-statistics/planner/config","items":[{"id":"30135","have":5,"need":5},{"id":"30125","have":7,"need":5},{"id":"30115","have":8,"need":5},{"id":"30074","have":10,"need":10},{"id":"30073","have":26,"need":20},{"id":"30084","have":21,"need":10},{"id":"30083","have":18,"need":20},{"id":"30094","have":10,"need":10},{"id":"30093","have":20,"need":20},{"id":"30104","have":10,"need":10},{"id":"30103","have":17,"need":20},{"id":"30014","have":15,"need":10},{"id":"30013","have":19,"need":20},{"id":"30012","have":44},{"id":"30011","have":32},{"id":"30064","have":8},{"id":"30063","have":12,"need":20},{"id":"30062","have":4},{"id":"30061","have":6},{"id":"30034","have":14},{"id":"30033","have":48,"need":20},{"id":"30032","have":54},{"id":"30031","have":38},{"id":"30024","have":21,"need":10},{"id":"30023","have":21,"need":20},{"id":"30022","have":127},{"id":"30021","have":16},{"id":"30044","have":25,"need":10},{"id":"30043","have":30,"need":20},{"id":"30042","have":60},{"id":"30041","have":21},{"id":"30054","have":10,"need":10},{"id":"30053","have":5,"need":20},{"id":"30052","have":12},{"id":"30051","have":17},{"id":"31014","have":25,"need":10},{"id":"31013","have":28,"need":20},{"id":"31024","have":10,"need":10},{"id":"31023","have":24,"need":20},{"id":"30145","have":5,"need":5},{"id":"31034","have":10,"need":10},{"id":"31033","have":3,"need":20}],"options":{"byProduct":true,"requireExp":true,"requireLmb":true},"excludes":[]}

After calculating the planner gives the following syntheses suggestions:

  • Device * 3
  • Integrated Device * 3
  • Polyketon * 8
  • Aketon * 10
  • Polymerized Gel * 4

The Polymerized Gel suggestion is incorrect, since I need only 10 and already have 25. I also have 5/5 晶体电子单元 which is the only higher level item that can be sythesized using Polymerized Gel.

Even if I increase the number of Polymerized Gels I have from 25 to 29 without changing other numbers, the planner still suggests me to sythesize 4 more Polymerized Gels.

What is expected?

The planner should not suggest me to synthesize any more Polymerized Gels.

What is actually happening?

The planner always suggests me to synthesize 4 more Polymerized Gels, even if I increase the number of Polymerized Gels I have.


I ran into this bug when synthesizing items using the planner. It keeps suggesting me to synthesize Polymerized Gels and I was confused.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.