Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

API: Add Post API #256

Open
wants to merge 14 commits into
base: go
Choose a base branch
from
Open

API: Add Post API #256

wants to merge 14 commits into from

Conversation

AnnsAnns
Copy link
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

This is a long-term draft for a Post API. The current ETA is late 2020

💡 Motivation and Context

Currently something I'm missing the most [Besides Manga support] is being able to integrate/update notify.moe through third-party applications. This draft plans to add all features needed to allow exactly that.

🔮 Next steps

Progress will always be updated on my forks project board: https://github.com/tumGER/notify.moe/projects/1

@AnnsAnns AnnsAnns changed the title Add Token Generation API: Add Post API Oct 29, 2020
arn/User.go Outdated Show resolved Hide resolved
server/New.go Show resolved Hide resolved
func GetUserFromToken(token uuid.UUID) *arn.User {
user := &arn.User{}

for user = range arn.StreamUsers() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could replace this O(n) loop with an O(1) lookup using a new collection in the DB ("TokenToUser") later on.

Otherwise this can become a huge bottleneck.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally wanted to implement this in a better way but I'm honestly too unfamiliar with nano so I didn't want to touch what I was unsure about.

server/tokenapi/AnimeList.go Outdated Show resolved Hide resolved
@AnnsAnns AnnsAnns marked this pull request as ready for review November 7, 2020 17:48
@AnnsAnns
Copy link
Contributor Author

AnnsAnns commented Nov 7, 2020

The post API is now technically fully functional, that's why I'm changing the PR status from "draft" to "open".

There are however 3 important things that should be addressed before merging this PR:

  1. The frontend under "pages/API.pixy" is currently awful, because I'm unfamiliar with the whole frontend. I'll definitely need help from you there.
  2. There is no documentation yet, I'll however commit that after/while this PR is getting reviewed.
  3. I've decided to stick with Gjson because I majorly dislike the standard json library [And the whole code is build around a dynamic JSON, which makes it even worse to handle with the standard library]. Besides that, Gjson makes the whole code a lot easier to understand. If needed, this has to be changed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants